Share via


Clock.Millis Method

Definition

Gets the current millisecond instant of the clock.

[Android.Runtime.Register("millis", "()J", "GetMillisHandler", ApiSince=26)]
public virtual long Millis ();
[<Android.Runtime.Register("millis", "()J", "GetMillisHandler", ApiSince=26)>]
abstract member Millis : unit -> int64
override this.Millis : unit -> int64

Returns

the current millisecond instant from this clock, measured from the Java epoch of 1970-01-01T00:00Z (UTC), not null

Implements

Attributes

Remarks

Gets the current millisecond instant of the clock.

This returns the millisecond-based instant, measured from 1970-01-01T00:00Z (UTC). This is equivalent to the definition of System#currentTimeMillis().

Most applications should avoid this method and use Instant to represent an instant on the time-line rather than a raw millisecond value. This method is provided to allow the use of the clock in high performance use cases where the creation of an object would be unacceptable.

The default implementation currently calls #instant.

Java documentation for java.time.Clock.millis().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to