Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Timer.getFPGATimestamp() vs System.currentTimeMillis() (http://www.chiefdelphi.com/forums/showthread.php?t=126389)

fovea1959 13-02-2014 11:12

Timer.getFPGATimestamp() vs System.currentTimeMillis()
 
coming from a desktop/server Java background, I've always used System.currentTimeMillis() for elapsed time calcs, and we use it on our bot consistently.

Just noticed Timer.getFPGATimestamp(), which strikes me as *probably* being better than System.currentTimeMillis() (though the former might be using the latter for all I know).

Anyone have any insight as too whether the two differ significantly? Don't want to do the rework if not significantly better (though will start with Timer.getFPGATimestamp() next year!)

Ether 13-02-2014 11:35

Re: Timer.getFPGATimestamp() vs System.currentTimeMillis()
 
Quote:

Originally Posted by fovea1959 (Post 1342404)
coming from a desktop/server Java background, I've always used System.currentTimeMillis() for elapsed time calcs, and we use it on our bot consistently.

Just noticed Timer.getFPGATimestamp(), which strikes me as *probably* being better than System.currentTimeMillis() (though the former might be using the latter for all I know).

Anyone have any insight as too whether the two differ significantly? Don't want to do the rework if not significantly better (though will start with Timer.getFPGATimestamp() next year!)

This thread has a discussion starting at post20 that might be of interest:

http://www.chiefdelphi.com/forums/sh....php?p=1224866




mmaunu 13-02-2014 11:39

Re: Timer.getFPGATimestamp() vs System.currentTimeMillis()
 
One difference is the resolution. Timer's method has a resolution of microseconds instead of currentTimeMillis()'s millisecond resolution.

fovea1959 14-02-2014 11:19

Re: Timer.getFPGATimestamp() vs System.currentTimeMillis()
 
thanks. I missed the difference in resolution. Not important enough to refit existing code (esp since Java TimerTasks only schedule down to the millisecond), but good to know.


All times are GMT -5. The time now is 22:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi