Here you can find the source of calculateTimeInSeconds(long startTimeInMilliseconds, long endTimeInMilliseconds)
private static long calculateTimeInSeconds(long startTimeInMilliseconds, long endTimeInMilliseconds)
//package com.java2s; public class Main { private static long calculateTimeInSeconds(long startTimeInMilliseconds, long endTimeInMilliseconds) { long timeInSeconds = endTimeInMilliseconds - startTimeInMilliseconds; float time = (float) timeInSeconds; float result = time / 1000; return (long) result; }//from w w w. j av a 2s . c o m }