Jump to content
  • Advertisement

This topic is 3647 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!