Ferenc
Ferenc

Reputation: 874

Is there a way of getting 'now' (at least) to millisecond precision in Julia?

Oftentimes, to know what happens when in your code you need high precision time to profile your app or for other reasons. Apparently, now() does not provide this feature, but is there another reasonably simple way to get 'now' to millisecond precision?

Upvotes: 4

Views: 498

Answers (1)

IainDunning
IainDunning

Reputation: 11664

From the docs:

help?> time

  time()

  Get the system time in seconds since the epoch, with fairly high (typically, microsecond) resolution.

So you can get the current DateTime using that. But if you just want relative time, for e.g. profiling, you could use tic() and toq(), or time_ns() for really high accuracy, or just time.

Upvotes: 4

Related Questions