|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Time precision better than seconds??
For a while out team has been looking to use a timer. The timer works well, except we need to have a more precise timer than the one that the documentation says is available. Is there a way to make a timer that is more precise (milliseconds/microseconds)?
|
|
#2
|
|||||
|
|||||
|
Re: Time precision better than seconds??
If I recall correctly, pretty much everything having to do with time is doubles, so that you have millisecond resolution for the time, but it is measured in seconds. That is, 200 ms would be 0.2 seconds.
|
|
#3
|
|||
|
|||
|
Re: Time precision better than seconds??
How accurate is the timing using floating-point precision? IEEE floating point representation isn't always 100% accurate; many times floats won't represent your value exactly as entered (e.g., 0.3 might become 0.2999...) so your times may end up slightly misrepresented internally.
Any reason as to why floating-point numbers were used instead of milli or microseconds? |
|
#4
|
||||
|
||||
|
Re: Time precision better than seconds??
The real-time timer has a precision down to microseconds i believe, but you wont have any luck searching for anything more fine than that (eg processor ticks)
|
|
#5
|
||||
|
||||
|
Re: Time precision better than seconds??
Quote:
IMPORT void vxTimeBaseGet (UINT32 * pTbu, UINT32 * pTbl); This function reads the 64-bit PPC timebase, storing the upper 32 bits at pTbu and the lower 32 bits at pTbl. The least significant bit should be worth 1/132,000,000 of a second. It would pay to do a little experimentation with it though, to see if that number is right -- it may actually be 1/133,000,000 seconds. In any event, it's a very high resolution 64-bit counter. Precise enough for ya? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Are six wheels better than four? | cziggy343 | General Forum | 36 | 10-01-2009 23:13 |
| Better Than Gears? | Aaron Lussier | Technical Discussion | 7 | 14-10-2003 12:20 |
| My auto is better than yours.. lol | randomperson | Programming | 25 | 07-04-2003 12:10 |
| Kennedy better than Long Island?... | soap108 | Regional Competitions | 6 | 23-03-2002 17:50 |
| Chief Delphi 7 Picture -- better than nothing | Joe Johnson | Robot Showcase | 7 | 02-03-2002 18:55 |