c# 测试运行时间毫秒级

时间:2021-08-03 02:49:47
 long currentMillis = (DateTime.Now.Ticks - (new DateTime(1970, 1, 1, 0, 0, 0, 0)).Ticks) / 10000;
 /*代码*/
 long currentMillis1 = (DateTime.Now.Ticks - (new DateTime(1970, 1, 1, 0, 0, 0, 0)).Ticks) / 10000;
 MessageBox.Show((currentMillis1 - currentMillis).ToString());