Monday, 7 May 2018

java - How can I know how much time has passed between two operations in my app?

I'm working on an Android app and I have this problem.



For example, if I delete a file (operation A) and I receive a new file (operation B), I want to know how much time has passed between the two operations. I want it to work also if, in between, the user changes the date of the system, turns off the internet or restarts the device.



I know that exists SystemClock.elapsedRealtime() but its value restarts from zero if the user restarts the device.



I cannot use System.currentTimeMillis() because it changes if user changes the date.



I cannot get a date from the internet.




Thanks

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...