开发者

Division of numbers

I could see in Timesta开发者_运维技巧mp class, the constructor goes like:

    public Timestamp(long time) {
    super((time/1000)*1000);
    ....................

What Im not understanding is, what is the need of dividing the time by 1000 and then multiplying again by 1000. What difference will it make? Isn't this piece redundant?


That's a way of truncating to the next lower multiple of 1000 milliseconds -- i.e., to the whole second. It's not necessarily the best way, but it's a way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜