|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Time in Milliseconds
What are you using currently to get the time?
GetTime() has nanosecond resolution, Timer::GetFPGATimestamp() has microsecond resolution, and the Timer class has microsecond resolution. |
|
#2
|
|||
|
|||
|
Re: Time in Milliseconds
Oh we were using the time class (time.h). We did not notice the timer class.
|
|
#3
|
|||
|
|||
|
Re: Time in Milliseconds
By the way, changing the resolution of the clock using low level VxWorks routines may wreak havoc on the timing of the rest of the system. Obviously you can do so, but do it carefully and test well.
Greg McKaskle |
|
#4
|
||||
|
||||
|
Re: Time in Milliseconds
use Wait(double seconds);
or a Timer |
|
#5
|
||||
|
||||
|
Re: Time in Milliseconds
BTW, in case you haven't found an optimal solution, I just implemented a GetMsecTime() macro today. The timer object seems a bit heavy to me. This is simple yet functional.
Code:
#define GetMsecTime() (GetFPGATime()/1000) |
|
#6
|
||||
|
||||
|
Re: Time in Milliseconds
If you want something simple and fast, use the standard C library's ctime (also known as time.h).
the function clock() returns the amount of ticks that have passed since your program started running as a clock_t value. The amount of ticks per second is defined in the macro CLOCKS_PER_SEC. Using this and some simple dimensional analysis, you can easily get how many miliseconds have passed between two clock() calls. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running Motor for X Milliseconds | DWirth | NI LabVIEW | 2 | 02-10-2010 07:54 AM |
| It's that time of year again!! (No, not The Championship event) Tax Time!! | Elgin Clock | Chit-Chat | 4 | 04-10-2005 10:59 AM |
| time? | roeperJTD06 | OCCRA | 1 | 11-21-2003 06:03 PM |
| time | archiver | 2000 | 3 | 06-23-2002 10:58 PM |