Movatterモバイル変換
[0]ホーム
{-# LINE1"System/CPUTime/Posix/Times.hsc"#-}{-# LANGUAGE CPP, CApiFFI, NumDecimals #-}moduleSystem.CPUTime.Posix.Times(getCPUTime,getCpuTimePrecision)whereimportData.RatioimportForeignimportForeign.CimportSystem.CPUTime.Utils-- for struct tms{-# LINE18"System/CPUTime/Posix/Times.hsc"#-}{-# LINE20"System/CPUTime/Posix/Times.hsc"#-}getCPUTime::IOIntegergetCPUTime=allocaBytes(32)$\p_tms->do{-# LINE23"System/CPUTime/Posix/Times.hsc"#-}_<-timesp_tmsu_ticks<-((\hsc_ptr->peekByteOffhsc_ptr0))p_tms::IOCClock{-# LINE25"System/CPUTime/Posix/Times.hsc"#-}s_ticks<-((\hsc_ptr->peekByteOffhsc_ptr8))p_tms::IOCClock{-# LINE26"System/CPUTime/Posix/Times.hsc"#-}return(((cClockToIntegeru_ticks+cClockToIntegers_ticks)*1e12)`div`fromIntegralclockTicks)typeCTms=()foreignimportccallunsafetimes::PtrCTms->IOCClockgetCpuTimePrecision::IOIntegergetCpuTimePrecision=return$round((1e12::Integer)%clockTicks)foreignimportccallunsafeclk_tck::CLongclockTicks::IntegerclockTicks=fromIntegralclk_tck
[8]ページ先頭