Original Post
I need a high resolution timer class that works for both Linux and Windows (by using #ifdefs etc, since I know that the platform independent C++ standard library time functions are too inaccurate). A. is there any good public domain implementation of this already, that you would recommend? or B. if I need to write it myself: 1. in Windows, which of the many possible implementations should I use? QueryPerformanceCounter() Windows timers (events, I think) GetTickCount() (someone said this one was inaccurate) timeGetTime() etc. etc. If possible, I would like one with at least millisecond resolution, and available on as much hardware as possible released since around year 2000. 2. in Linux, which of the many possible implementations should I use? gettimeofday() time() gethrtime() gethrvtime() As with the windows timer, I'm looking for as good hardware compatibility as possible, and millisecond resolution. It should also not be available only on a small number of Linux distributions, but is part of the standard so I can expect it to work on all of the major distributions.