Get time in milliseconds using C#

后端 未结 8 1632
你的背包
你的背包 2021-01-30 09:56

I\'m making a program in which I need to get the time in milliseconds. By time, I mean a number that is never equal to itself, and is always 1000 numbers bigger than it was a se

8条回答
  •  梦如初夏
    2021-01-30 10:32

    Using Stopwatch class we can achieve it from System.Diagnostics.

    Stopwatch stopwatch  = new Stopwatch();
    stopwatch.Start();
    stopwatch.Stop();
    Debug.WriteLine(stopwatch.ElapsedMilliseconds);
    

提交回复
热议问题