Time

Started by
2 comments, last by Electrons 15 years, 10 months ago
Is there any simple, cross-platform method of getting time, accurate to milliseconds, in C? I am working on a game (surprise surprise) and everything so far is platform independent, I would like to keep it that way. Is there any way to get time in milliseconds?
Advertisement
Here ya go.
Thanks a bunch -- is gettimeofday() compatible with windows()? I code on linux, so I have no way of testing, but obviously I would like the program to run as seamlessly as possible on both OS's.

Thanks.
There is a way to get gettimeofday() to work on Windows. However, I've heard that gettimeofday() and ftime() aren't quite in-sync with Windows time, but time() is always accurate. Maybe give the link above a shot and see what comes out...?

This topic is closed to new replies.

Advertisement