TeamShadow / shadow

Reference compiler for the Shadow programming language.
http://shadow-language.org/
Apache License 2.0
12 stars 8 forks source link

System nanoTime() #48

Closed claude-abounegm closed 7 years ago

claude-abounegm commented 7 years ago

System.nanoTime() does not return the correct epoch time. Time.epochNow() in the pull request does return the correct epoch time, however, more research has to be put into it.

claude-abounegm commented 7 years ago

The current System has been updated to contain two methods: epochNanoTime() and nanoTime(). epochNanoTime() is expected to be used when epoch is expected; otherwise, for timing the applications, nanoTime() is expected to be used. Another useful method is Time.epochNow() which returns a TimeSpan, which has a lot of features that breakdown the time into months, weeks, days, hours, etc...