Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is Android/Java corresponding method to the C#/C++ method GetTickCount()?

Tags:

java

c++

c#

android

I wanna know a corresponding method in Android/Java that is like the GetTickCount method in C#/C++?

like image 314
Curtain Avatar asked Dec 17 '22 22:12

Curtain


1 Answers

For Android it is SystemClock.uptimeMillis(). Please note that uptimeMillis() does not include time spent in deep sleep. You may need SystemClock.elapsedRealtime() for total time after boot.

like image 157
Ognyan Avatar answered Dec 28 '22 07:12

Ognyan