Here you can find the source of printTimestamp()
public static void printTimestamp()
//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(); } }