This topic is 3462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...?

Share this post


Link to post
Share on other sites

This topic is 3462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this