110,538
社区成员
发帖
与我相关
我的任务
分享
static void Main()
{ Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
long c=stopWatch.ElapsedMilliseconds;
Thread.Sleep(100);
long d=stopWatch.ElapsedMilliseconds;
Console.WriteLine(d-c);
long i=DateTime.Now.Ticks;
Thread.Sleep(100);
i-=DateTime.Now.Ticks;
Console.WriteLine(i/10000);
}
Public Function GetTickCount() As Integer
Dim n As Integer
n = Environment.TickCount
If n >= 0 Then
Return n
Else
Return n And Int32.MaxValue '0,1,2,3,-3,-2,0 -> 0,1,2,3,0,1,2,3
End If
End Function
我是这么写的