[PATCH] randomize benchtests

chrubis@suse.cz chrubis@suse.cz
Mon Apr 22 16:59:00 GMT 2013


Hi!
> Do you know more portable way to get CPU frequency than reading /dev/cpuinfo?
> I need that to display data at cycles which are more natural unit than
> nanoseconds.

You can use 'cpufreq-info -f' on Linux, on BSD's you need to play with
sysctl. There is a sysctl 'emulation' on Linux that uses /proc, but that
doesn't work for CPU speed.

But be wary that CPU speed is subject to change when CPU scaling is
active, which is on on most of the modern systems.

-- 
Cyril Hrubis
chrubis@suse.cz



More information about the Libc-alpha mailing list