| Portability | at own risk. Amd64/linux tested and working. |
|---|---|
| Stability | experimental |
| Maintainer | echo@echonolan.net |
| Safe Haskell | None |
System.CPUTime.Rdtsc
Description
This module provides the function rdtsc for accessing the equivalent of x86's rdtsc instruction on your processor. To oversimplify quite a bit, this is the number of clock cycles since bootup. You should generally only use this as a source of relative time.
As an example, you may use the following program to measure the overhead of calling this function:
module Main where
import System.CPUTime.Rdtsc
main = do
t1 <- rdtsc
t2 <- rdtsc
putStrLn ("Cost of rdtsc (ffi call): " ++ show (t2 - t1))