anaotha
anaotha

Reputation: 623

How to get current time in milliseconds in Rascal

I want to debug a slow function in Rascal, to find out why it is slow. To do this, I want to save the system time in milliseconds at certain locations so I can measure the time taken by certain parts of the code.

I have looked at the DateTime module (http://tutor.rascal-mpl.org/Rascal/Expressions/Values/DateTime/DateTime.html), but it does not seem easy to compute time differences this way. Is there any better way?

Upvotes: 0

Views: 63

Answers (1)

Davy Landman
Davy Landman

Reputation: 15438

There is a buildin profiler in rascal, that does function and statement level profiling. You can enable it with :set profiling true in the repl.

If you want to do benchmarking, take a look at util:;Benchmark

Upvotes: 2

Related Questions