System.Diagnostics.Stopwatch Stopwatch = new System.Diagnostics.Stopwatch ();
Stopwatch. Start ();
Here: time-consuming processes/methods need to be calculated
Stopwatch. Stop ();
Stopwatch. Elapsed.totalseconds//Here is the total running seconds of the output, accurate to milliseconds
System.Diagnostics.Stopwatch Stopwatch =NewSystem.Diagnostics.Stopwatch (); Stopwatch. Start ();byte[] A = System.IO.File.ReadAllBytes ("x:\\ new text document. txt"); Textbox2.appendtext ("\ r \ n Load file total 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 Encryption complete length {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 completed total length {1} time {0} seconds". Formatwith (stopwatch. Elapsed.totalseconds, C.length)); stopwatch. Stop ();
[C #] Logger time-consuming method "forward"