Java Utililty Methods Micro Second Convert

List of utility methods to do Micro Second Convert

Description

The list of methods to do Micro Second Convert are organized into topic(s).

Method

voiddelayMicroseconds(int microseconds)
Delay in microseconds.
try {
    Thread.sleep(0, microseconds * 1000);
} catch (InterruptedException e) {
doublemicroseconds2seconds(double us)
microsecondsseconds
return 0.000001 * us;
longmicrosecondsToFrames(double frameRate, long microseconds)
microseconds To Frames
return (long) ((microseconds / 1000) / ((1d / frameRate) * 1000));
StringmicrosecondsToReadableTime(long microseconds)
microseconds To Readable Time
long l_seconds = microseconds / MICROSECONDS_PER_SECOND;
int hours = (int) Math.floor(l_seconds / 3600 % 60);
int minutes = (int) Math.floor(l_seconds / 60 % 60);
int seconds = (int) (l_seconds % 60);
return td(hours) + ":" + td(minutes) + ":" + td(seconds);