Creating a Timer

closed account (D3pGNwbp)
I'm looking to create some sort of a timer. I'd like it to count by milliseconds and return a true value when it counts to a specific time.

It would be used something like this:
1
2
3
4
5

if(alarm(1000)) {
   // do some code
}


I tried using time.h, but it doesn't seem to have any millisecond commands. I need something faster than a second.

Could anybody give me any suggestions or tips? Thanks guys!

Last edited on
http://www.cplusplus.com/reference/chrono/

Look toward the bottom. I haven't used any of the time libraries yet, so I can't advise you on how to correctly use them.
closed account (D3pGNwbp)
@Daleth
Thank you very much! Exactly what I was looking for!
Last edited on
Topic archived. No new replies allowed.