View Single Post
  #7   Spotlight this post!  
Unread 22-02-2010, 08:47
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
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.
__________________
Reply With Quote