Hope to get some pointers here. I am trying to get QT to compile with slightly different code for each platform. For instance,
If the platform is Windows, then enable windows.h
If the OSX platform includes time.h
and
If the Windows platform uses the QueryPerformanceCounter function from windows.h If the Linux platform uses the gettimeofday function from time.h
The goal is to write a wrapper function to return expired microseconds that work with Windows (QueryPerformanceCounter) and Linux / Max (gettimeofday) without having 2 sets of code. Qtimer permission does not meet the requirements of Windows XP. (about 10-15 ms).
Can anyone point me to a tutorial on how to do this? Thank you in advance and Happy New Year to all.
Gary cho
source
share