WallClock, high resolution timing snippet. back

(L) [2006/05/10] [tbp] [WallClock, high resolution timing snippet.] Wayback!

After some surgery i've extracted [LINK http://ompf.org/tidbits/wallclock.cc]


Works on win32 with msvc8 & gcc, but i haven't checked if it's still ok on Hippie OS.


You should be careful and know what you're doing when using that code, i'll put proper warnings & disclaimers wrapped in some html later.
(L) [2006/05/10] [tbp] [WallClock, high resolution timing snippet.] Wayback!

I have a frontal include that abstracts compilers & platforms; there AMD64 is defined much like WIN32 when it makes sense.


So you shouldn't use '#if defined(AMD64) or define(__GNUC__)' but set AMD64, because that's a platform specific thing and not a compiler specific thing.

Including stdint.h is right, that's what i do; it seems that my cut-n-paste-fu is weak [SMILEY Wink]
(L) [2006/05/10] [Ho Ho] [WallClock, high resolution timing snippet.] Wayback!

He actually meant that usign AMD64 keyword to define 64bit Linux is not the best way. Using separate flags for 64bit and Linux would be much better.


Btw, in what header is the bool_t defined? I tried to merge it in phantom's code and it gave me errors about that not being defined.
_________________
In theory, there is no difference between theory and practice. But, in practice, there is.

Jan L.A. van de Snepscheut
(L) [2006/05/10] [tbp] [WallClock, high resolution timing snippet.] Wayback!

Argh. My bad.


bool_t is an unsigned integer.

back