Here you can find the source of getElapsedTimeInMilliseconds(Date startDate, Date endDate)
Parameter | Description |
---|---|
startDate | The initial start date. |
public static long getElapsedTimeInMilliseconds(Date startDate, Date endDate)
//package com.java2s; import java.util.*; public class Main { /**/* w ww . j a va2 s . c o m*/ * Return the elapsed time between the start date and now. Returns a String * representation in HH:MM:SS format. * @param startDate The initial start date. * @return Elapsed time between the start date and now. */ public static long getElapsedTimeInMilliseconds(Date startDate, Date endDate) { // Convert to milliseconds. long startMilliseconds = startDate.getTime(); long endMilliseconds = endDate.getTime(); return endMilliseconds - startMilliseconds; } }