In article <Dj*******************@newssvr21.news.prodigy.com> ,
ti***********@xxxxsbcglobal.net says...
clock() is the closest thing in standard C. I don't know what dev-c++ is,
but it's surely off topic. You could count CPU clock ticks. Look up rdtsc.
Unfortunately, according to Intel there is no guarantee that rdtsc will
give you useful data on a SMP system, as the rdtsc result is not
synchronized between CPUs. If your process gets bumped to another CPU,
your results will be WAY off. This used to be good advice (if you didn't
mind not being portable off of some x86 CPUs), but with SMP systems
becoming increasingly common, it's horribly broken now. If you're using
a broken thread implementation (I.e. one which lets you pin a thread to a
physical CPU) then it might be useful for you, but only if the code gets
called from a single thread. For conventional processes, forget about it.