Package org.apache.nutch.util
Class TimingUtil
java.lang.Object
org.apache.nutch.util.TimingUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringelapsedTime(long start, long end) Calculate the elapsed time between two times specified in milliseconds.static StringlogDateMillis(long millis) Convert epoch milliseconds (System.currentTimeMillis()) into date string (local time zone) used for loggingstatic StringsecondsToDaysHMS(long seconds) Show time in seconds as days, hours, minutes and seconds (d days, hh:mm:ss)static StringsecondsToHMS(long seconds) Show time in seconds as hours, minutes and seconds (hh:mm:ss)
-
Field Details
-
logDateFormat
Formats dates for logging
-
-
Constructor Details
-
TimingUtil
public TimingUtil()
-
-
Method Details
-
logDateMillis
Convert epoch milliseconds (System.currentTimeMillis()) into date string (local time zone) used for logging- Parameters:
millis- A epoch milliseconds representation- Returns:
- a local time zone date string
-
elapsedTime
Calculate the elapsed time between two times specified in milliseconds.- Parameters:
start- The start of the time periodend- The end of the time period- Returns:
- a string of the form "XhYmZs" when the elapsed time is X hours, Y minutes and Z seconds or null if start > end.
-
secondsToHMS
Show time in seconds as hours, minutes and seconds (hh:mm:ss)- Parameters:
seconds- (elapsed) time in seconds- Returns:
- human readable time string "hh:mm:ss"
-
secondsToDaysHMS
Show time in seconds as days, hours, minutes and seconds (d days, hh:mm:ss)- Parameters:
seconds- (elapsed) time in seconds- Returns:
- human readable time string "d days, hh:mm:ss"
-