module CPUTime(getCPUTime) where import NHC.GreenCard import CpuTimePrecision getCPUTime :: IO Integer getCPUTime = do i <- clock () return (toInteger i * cpuTimePrecision) %-#include %- %fun clock :: () -> IO Int %call () %code % i = clock(); %result (declare "clock_t" i in int i)