Java System.currentTimeMillis() equivalent in C#

前端 未结 11 1090
-上瘾入骨i
-上瘾入骨i 2020-12-13 01:18

What is the equivalent of Java\'s System.currentTimeMillis() in C#?

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 02:04

    I know question asks for equivalent but since I use those 2 for the same tasks I throw in GetTickCount. I might be nostalgic but System.currentTimeMillis() and GetTickCount() are the only ones I use for getting ticks.

    [DllImport("kernel32.dll")]
    static extern uint GetTickCount();
    
    // call
    uint ticks = GetTickCount();
    

提交回复
热议问题