BeTimePoint Class

A specific point in time relative to the current time. BeTimePoints are used for timing operations. They are created from a BeDuration relative to the "now". BeTimePoints are immutable.

Methods

Name Description
after(other: BeTimePoint): boolean Determine whether this BeTimePoint happens after another one.  
before(other: BeTimePoint): boolean Determine whether this BeTimePoint happens before another one.  
minus(duration: BeDuration): BeTimePoint Subtract a BeDuration from this BeTimePoint, returning a new BeTimePoint.  
plus(duration: BeDuration): BeTimePoint Subtract a BeDuration from this BeTimePoint, returning a new BeTimePoint.  
beforeNow(val: BeDuration): BeTimePoint Static Create a BeTimePoint at a specified duration in the past before now  
fromNow(val: BeDuration): BeTimePoint Static Create a BeTimePoint at a specified duration in the future from now  
now(): BeTimePoint Static Create a BeTimePoint from Date.now()  

Properties

Name Type Description
isInFuture Accessor ReadOnly boolean Determine whether this BeTimePoint is a time in the future from the time this method is called (it calls now()!)  
isInPast Accessor ReadOnly boolean Determine whether this BeTimePoint is a time that has already passed before the time this method is called (it calls now()!)  
milliseconds Accessor ReadOnly number the time in milliseconds, of this BeTimePoint (relative to January 1, 1970 00:00:00 UTC.)  

Defined in

Last Updated: 30 November, 2023