Skip to content

Try to calculate the CPU frequency by using the rdtsc instruction

Notifications You must be signed in to change notification settings

NikAleksandrov/rdtscfreq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

rdtscfreq -  A small and simple tool which tries to calculate the
	     running CPU's frequency by using the rdtsc instruction

The idea is simple: use the rdtsc instruction to get the current cycles,
		    sleep 1 second and then use it again, calculate the
		    difference, which in an ideal world without sleeping
		    and frequency changes should be the CPU's frequency in HZ.

Requirement: The running CPU should support the rdtsc instruction.

Compilation:
 # make
The above command should produce an executable called "rdtscfreq"
in the current directory.

Usage: rdtscfreq

Example:
# ./rdtscfreq
CPU MHz: 2791

About

Try to calculate the CPU frequency by using the rdtsc instruction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages