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