Many times it takes time for the output program to be recorded,
always start recording the current point of time at the beginning of the program execution, at the end of the record end point in time, and then subtract two times, so is there any other way to be a little bit more presentable? Tell you, there is a drop; ) the subject of this method is
Stopwatch
His description is: For accurate measurement of the running time, you need to record time-consuming students who applause?
Specific use: System.Diagnostics.
Stopwatch Stopwatch = new System.Diagnostics.Stopwatch (); stopwatch. Start (); //here: time-consuming process/method needs to be calculated stopwatch. Stop (); stopwatch.
Elapsed.
totalseconds //Here is the total running seconds of the output, accurate to milliseconds
System.Diagnostics.Stopwatch Stopwatch = new System.Diagnostics.Stopwatch (); Stopwatch. Start (); Byte[] A = System.IO.File.ReadAllBytes ("x:\\ new text document. txt"); Textbox2.appendtext ("\ r \ n Load file length {1} time {0} seconds ".) Formatwith (stopwatch. Elapsed.totalseconds, A.length)); Stopwatch. Reset (); Stopwatch. Start (); Byte[] B = LC. Fun.Hash.AES_Encrypt (A, "#[email protected] $DJGJ #1a!2"); Textbox2.appendtext ("\ r \ n The total length of the encryption {1} time {0} seconds".) Formatwith (stopwatch. Elapsed.totalseconds, B.length)); Stopwatch. Reset (); Stopwatch. Start (); Byte[] C = LC. Fun.Hash.AES_Decrypt (b, "#[email protected] $DJGJ #1a!2"); Textbox2.appendtext ("\ r \ n Decryption complete length {1} time {0} seconds".) Formatwith (stopwatch. Elapsed.totalseconds, c.length));
[C #] How time-consuming to log programs