Java Millisecond Current Get currentTimeMillis()

Here you can find the source of currentTimeMillis()

Description

current Time Millis

License

Apache License

Declaration

public static synchronized long currentTimeMillis() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static long timeCorrection;
    private static long lastTimeUpdate;

    public static synchronized long currentTimeMillis() {
        long l = System.currentTimeMillis();
        if (l < lastTimeUpdate)
            timeCorrection += lastTimeUpdate - l;
        lastTimeUpdate = l;//  w w  w  .j  a  v  a 2 s .  co  m
        return l + timeCorrection;
    }
}

Related

  1. currentTimeMillis()
  2. currentTimeMillis()
  3. currentTimeMillis()
  4. currentTimeMillis()
  5. currentTimeMillis()