Navigation
Synopsis CPU time in nanoseconds (10-9 sec).
Function
  1. int cpuTime()
  2. int cpuTime(void () block)
Usage import util::Benchmark;
Description
  1. Current cpu time in nanoseconds (10-9 sec) since the start of the thread that runs the code that calls this function.
  2. The cpu time in nanoseconds used by the execution of the code block.
Examples We use the factorial function described in Recipes:Factorial as example: These two timings for the same task may differ significantly due to the way these statements are executed here in the tutor.
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.