rusti icon indicating copy to clipboard operation
rusti copied to clipboard

Add a way to time how long functions take to execute

Open 7sharp9 opened this issue 8 years ago • 1 comments

e.g. In F# interactive you would use:

> #time;;
--> Timing now on
> let rec fib n = if n < 2 then 1 else fib (n-1) + fib(n-2);;
Real: 00:00:00.000, CPU: 00:00:00.000, GC gen0: 0, gen1: 0
val fib : n:int -> int

> fib 42;;
Real: 00:00:02.615, CPU: 00:00:02.612, GC gen0: 0, gen1: 0
val it : int = 433494437

Its a nice feature in F#, I thought it may be useful in rusti. Im not exactly sure how easy it would be to add?

7sharp9 avatar Dec 06 '15 20:12 7sharp9

That does look useful. It seems pretty straightforward to add as a rusti command. The only obvious impediment would be finding an operating system-independent means of measuring CPU time used over a span of real time.

murarth avatar Dec 07 '15 05:12 murarth