Here you can find the source of elapsedMillis(long t0nanos, long t1nanos)
public static long elapsedMillis(long t0nanos, long t1nanos)
//package com.java2s; /*/*from w ww . j av a2s . com*/ * Copyright ?2012 Jawfish Games Inc * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ public class Main { /** * Get the elapsed milliseconds between two nano times */ public static long elapsedMillis(long t0nanos, long t1nanos) { return (t1nanos - t0nanos) / 1000000; } /** * Get the elapsed milliseconds since the given nano time. */ public static long elapsedMillis(long t0) { return elapsedMillis(t0, t0()); } /** * Get the current time in nanos */ public static long t0() { return System.nanoTime(); } }