Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public enum TimeUnit

  1. Object
  2. Enum<TimeUnit>
  3. TimeUnit

ImplementsComparable<TimeUnit>

Compile-time API for time units. Runtime implementations come from the host JDK, Android, TeaVM, or vm/JavaAPI on ParparVM, as with the other CLDC stubs.

Enum constants

NANOSECONDS
MICROSECONDS
MILLISECONDS
SECONDS
MINUTES
HOURS
DAYS

Methods

public static TimeUnit[] values()
public static TimeUnit valueOf(String name)
public long convert(long duration, TimeUnit sourceUnit)
public long toNanos(long duration)
public long toMicros(long duration)
public long toMillis(long duration)
public long toSeconds(long duration)
public long toMinutes(long duration)
public long toHours(long duration)
public long toDays(long duration)
public void timedWait(Object object, long timeout) throws InterruptedException
public void timedJoin(Thread thread, long timeout) throws InterruptedException
public void sleep(long timeout) throws InterruptedException

Inherited methods

Enum constant details

NANOSECONDS

NANOSECONDS

MICROSECONDS

MICROSECONDS

MILLISECONDS

MILLISECONDS

SECONDS

SECONDS

MINUTES

MINUTES

HOURS

HOURS

DAYS

DAYS

Method details

values

public static TimeUnit[] values()

valueOf

public static TimeUnit valueOf(String name)

convert

public long convert(long duration, TimeUnit sourceUnit)

toNanos

public long toNanos(long duration)

toMicros

public long toMicros(long duration)

toMillis

public long toMillis(long duration)

toSeconds

public long toSeconds(long duration)

toMinutes

public long toMinutes(long duration)

toHours

public long toHours(long duration)

toDays

public long toDays(long duration)

timedWait

public void timedWait(Object object, long timeout) throws InterruptedException

timedJoin

public void timedJoin(Thread thread, long timeout) throws InterruptedException

sleep

public void sleep(long timeout) throws InterruptedException