The rdtsc package
This module provides the function rdtsc for accessing the rdtsc machine register on modern IA-32 processors. This is a 64-bit counter which counts the number of processor cycles since the machine has been powered up. Using this instruction, you can make very precise time measurements which are independent of the actual CPU frequency. But note that you can get strange results sometimes on a superscalar processor.
Also note that the Haskell foreign function interface imposes some additional overheads. On my machine, it takes about 950 cycles to call this function twice and to compute the difference, whereas in C the overhead is only about 88 cycles.
Properties
| Versions | 1.1.1, 1.1.3, 1.1.3.1, 1.2.0.0, 1.3.0.0 |
|---|---|
| Dependencies | base (4.*) |
| License | BSD3 |
| Author | Martin Grabmueller <martin@grabmueller.de> |
| Maintainer | martin@grabmueller.de |
| Stability | Experimental |
| Category | Foreign binding |
| Home page | http://code.haskell.org/rdtsc |
| Source repository | darcs get http://code.haskell.org/rdtsc/ |
| Upload date | Thu Mar 15 21:41:53 UTC 2012 |
| Uploaded by | MartinGrabmueller |
| Built on | ghc-7.4 |
Modules
- System
- CPUTime
Downloads
- rdtsc-1.3.0.0.tar.gz (Cabal source package)
- package description (included in the package)