RosettaCodeData/Task/Time-a-function/Standard-ML/time-a-function.ml

8 lines
171 B
OCaml
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
fun time_it (action, arg) = let
val timer = Timer.startCPUTimer ()
val _ = action arg
val times = Timer.checkCPUTimer timer
in
Time.+ (#usr times, #sys times)
end