Java Time Print printTimestamp()

Here you can find the source of printTimestamp()

Description

print Timestamp

License

Open Source License

Declaration

public static void printTimestamp() 

Method Source Code

//package com.java2s;
/******************************************************************************
 * Copyright (c) 2007 Stefan Franke, Robert Hanussek, Benjamin Keil,          *
 *                    Steffen Kie?, Johannes Langauf,                         *
 *                    Christoph Marian M?ller, Igor Podolskiy,                *
 *                    Tilmann Scheller, Michael Starzmann, Markus Wittlinger  *
 * All rights reserved. This program and the accompanying materials           *
 * are made available under the terms of the Eclipse Public License v1.0      *
 * which accompanies this distribution, and is available at                   *
 * http://www.eclipse.org/legal/epl-v10.html                                  *
 ******************************************************************************/

public class Main {
    private static long LAST_TIMESTAMP;

    public static void printTimestamp() {
        long diff = System.currentTimeMillis() - LAST_TIMESTAMP;
        resetTimestamp();/*from   w w w  . jav  a 2s .  c o m*/
        System.out.printf("TIME: %,11dms", new Long(diff));
    }

    public static void resetTimestamp() {
        LAST_TIMESTAMP = System.currentTimeMillis();
    }
}

Related

  1. printTime(long starttime, long endtime)
  2. printTime(long time, String spacer)
  3. printTime(String msg)
  4. printTimer(String blah)
  5. printTimes(String what, long... args)
  6. printTimeStamp(final String msg)
  7. printTimeTakenMs(String msg, long start, long finish)
  8. standardTime(Date date)