Go to Post Your GPA in High School and College is a reflection of your cooperation with educational processes, nothing more. It is NOT a measurement of how much you know or how much you can learn. - Mike Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2014, 11:12
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 330
fovea1959 will become famous soon enough
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!)
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2014, 11:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Timer.getFPGATimestamp() vs System.currentTimeMillis()

Quote:
Originally Posted by fovea1959 View Post
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




Last edited by Ether : 13-02-2014 at 11:39.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2014, 11:39
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 87
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
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.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2014, 11:19
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 330
fovea1959 will become famous soon enough
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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