Version: 0.1.0
Release date: 2002-01-29
Home page: http://aspectr.sf.net/perfctr
Tarball: http://prdownloads.sf.net/aspectr/perfctr-0-1-0.tar.gz
Author: Robert Feldt
Email: feldt@ce.chalmers.se
Simple wrappers for accessing CPU and OS performance counters.
Includes both a "convenience" API for simple but accurate
measurements and a low-level API for increased effeciency and maximum
functionality.
Currently this is very limited and can simply be used for high-resolution
timing.
In the long run we will probably build this on top of PAPI
the standard, portable PerformanceAPI available from
http://icl.cs.utk.edu/papi. PAPI will give a common interface to
performance counting on multiple processors and operating systems.
However, it does not yet support the windows platform.
Currently only if you have a Pentium machine running Windows 2000 and
cygwin. Should work on NT but this haven't been tested. Since at least
the pentium has a special machine instruction for acessing the counter
we need it should be simple to do it also on linux. If you do it please
send me the code and I'll extend this to work on Linux.
- unpack tarball (if you haven't already)
- ruby extconf.rb
- make
- make install
require 'perfctr'
t = PerformanceCounters.time do
# lengthy calculation here...
end
# t contains the number of wallclock seconds the computation took
ANSI C compiler, Ruby and cygwin.
None yet but there are very few methods. See the file in the tests dir.
Copyright (c) 2001, 2002 Robert Feldt, feldt@ce.chalmers.se.
All rights reserved.
and they are distributed under GPL. See LICENSE.
The timer measures real (wallclock) time. NOT user time in your Ruby process.
Thus you should not use for timing your process over long periods.
When PAPI works on Windows use it instead to get multi-platform conformance.
I'd appreciate if you drop me a note if you're successfully using
PerfCount. If there are some known users I'll be more motivated to
packing up additions / new versions and post them to RAA.
Happy coding!
Robert Feldt, feldt@ce.chalmers.se