Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.currentTimeMillis() should return milliseconds hnsecs instead of hnsecs. #11

Open
jmcabo opened this issue Apr 14, 2013 · 1 comment

Comments

@jmcabo
Copy link
Contributor

jmcabo commented Apr 14, 2013

I realized while porting a small benchmark both in java and D that there was something strange in System.currentTimeMillis(). It is returning hecto nano seconds in the phobos implementation:

    static long currentTimeMillis(){
        version(Tango) return tango.time.Clock.Clock.now().ticks() / 10000;
        else           return std.datetime.Clock.currStdTime();
    }

The fix is to divide by 10000, as in the tango version:

    static long currentTimeMillis(){
        version(Tango) return tango.time.Clock.Clock.now().ticks() / 10000;
        else           return std.datetime.Clock.currStdTime() / 10000;
    }
jmcabo added a commit to jmcabo/base that referenced this issue Apr 14, 2013
… return milliseconds hnsecs instead of hnsecs.
@jacob-carlborg
Copy link
Member

Could you please make a pull request out of that commit?

jacob-carlborg added a commit that referenced this issue Apr 14, 2013
Fix for issue #11 (System.currentTimeMillis() in phobos).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants