RAA - clockcount

clockcount / 0.1

Short description: access processor specific clock counter
Category: Library/Date
Status: experimental
Created: 2006-01-01 12:16:58 GMT
Last update: 2006-01-01 12:16:58 GMT
Owner: Tanaka Akira (Projects of this owner)
Homepage: http://www.a-k-r.org/clockcount/
Download: http://www.a-k-r.org/clockcount/
License: BSD-type
Dependency:
None
Description:

clockcount

clockcount access processor specific clock counter.

Usage

require 'clockcount'
p ClockCount()

Sample Script to Mesure Clock Speed

% ruby sample.rb 
0x171faf0c3cbed
0x171fb3e46f666 1.30258316772774[GHz]
0x171fb8a2981c2 1.27298907227854[GHz]
0x171fbd7ae77dc 1.30054508000412[GHz]
0x171fc21e131d4 1.24473258972987[GHz]
0x171fc6d123ecf 1.26146415868276[GHz]
...

Supported Platforms

  • Intel Pentium (rdtsc, 64bit)
  • AMD64, Intel EM64T (rdtsc, 64bit)
  • Intel Itanium (IA64) (ar44 register, 64bit)
  • PowerPC (PowerPC603, POWER3 or later) (mftb and mftbu, 64bit)
  • Sun UltraSparc (tick register, 64bit)
  • HP PA-RISC 2.0 (cr16 register, 64bit)

Note

The meaning of "clock" varys on platforms. For example, the counter doesn't count CPU clocks on PowerPC.

Edit this project (for project owner)

back to RAA top