![]() |
|
Navigation |
Synopsis System time in nanoseconds (10
-9 sec).
Function
Usage
import util::Benchmark;
Description
Examples We use the factorial function described in Recipes:Factorial as example:
rascal>import util::Benchmark; ok rascal>import demo::basic::Factorial; okHere we measure time by using separate calls to sytemTime before and after a call to fac .
rascal>before = systemTime(); int: 3160905000 rascal>fac(50); int: 30414093201713378043612608166064768844377641568960512000000000000 rascal>systemTime() - before; int: 961000The code to be measured can also be passed as a function parameter to systemTime :
rascal>systemTime( void() { fac(50); } );
int: 9000
![]() |