Skip to content

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

@jmcabo

Description

@jmcabo

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions