clock time in milliseconds into a c program

Claudiu Dragalina-Paraipan dr.clau at gmail.com
Fri Jan 21 01:58:19 PST 2005


Or you can use PERFMON. Check manual page for perfmon.
It gives you access to internal counters of CPU.

Of course this is a subjective measurement, since, AFAIK, the counters
are not kept separately for every process, but for entire system,
including kernel.
Maybe repeating the same measurement for many times, with a system
running no other CPU consumers, you will get a more accurate
measurement

.


On Fri, 21 Jan 2005 02:19:15 +0000, Joseph Koshy <joseph.koshy at gmail.com> wrote:
> > I don't think there is a streight way to speed-up the default
> > unix time resolution, which is, as far as i know, in
> > microseconds.
> 
> On i386 (and possibly amd64) platforms you can use the
> RDTSC instruction to get a direct measure of processor
> cycles elapsed.
> 
> --
> FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
> 


-- 
Claudiu Dragalina-Paraipan
e-mail: dr.clau at gmail.com


More information about the freebsd-hackers mailing list