Cross platform millisecond timer lasting more than 49 days?

Posted by Cetra on Stack Overflow See other posts from Stack Overflow or by Cetra
Published on 2010-04-06T13:49:58Z Indexed on 2010/04/06 13:53 UTC
Read the original article Hit count: 210

Hey guys,

I'm going to be developing a small dedicated server in C/C++ that will require uptime of forever. I've been looking into some time functions as millisecond timing is required for calculations. I have 2 problems that I'm facing:

  1. Using a 32bit integer to store the number of milliseconds since the operation began will wrap around at about the 49 days mark resetting to zero.

  2. There doesn't seem to be any standard system calls for getting elapsed milliseconds that are platform independant

What should I do to resolve both these issues?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c