Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is View.getDrawingTime()?

Tags:

android

I'd like to use View.getDrawingTime(), however, I am confused as to the value the function returns.

in my app, getDrawingTime() returns something along the lines of 545366733 Compared to System.currentTimeMillis() I see 1375750319462

The documentation is fairly inadequate in this case : http://developer.android.com/reference/android/view/View.html#getDrawingTime()

How can I compare the value I get from getDrawingTime() to currentTimeMillise() (or something similar) ?

I desire to know the time difference between now and the last time the view was drawn.

Thanks !!

like image 522
Someone Somewhere Avatar asked Feb 06 '26 17:02

Someone Somewhere


1 Answers

I didn't dig far enough to be 100% certain, but I got to 99.7%.

Both scheduleDrawable() and the internal fadeStartTime use the SystemClock.uptimeMillis() clock. My guess is that getDrawingTime() does too.

Note that SystemClock.uptimeMillis() does not count time when in deep sleep. So, if you're trying to time events between sessions, you might want to try something else.

An alternative is to override your View's onDraw() and set your own timer, but it's up to what you need, really.

like image 172
Geobits Avatar answered Feb 09 '26 07:02

Geobits



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!