Another (very simple) possibility :
- bevor you write your data to the Serialport you read Now into a Variable (type Date)
- when you have finished the Serialport.write you build the difference (as timeSpan) between your Variable and Now - this Shows you also the elapsed time (in Seconds or Milliseconds - like you want)
That could look like this :
System.DateTime myStart = System.DateTime.Now;
serialPort1.Write(System.IO.File.ReadAllText(this.txtfilePo.Text));
System.TimeSpan myTimespan = System.DateTime.Now.Subtract(myStart);
Int myElapsedTime = myTimespan.Seconds * 1000 + myTimespan.Milliseconds;