BeDuration Class

A duration of time. Can be either positive (towards future) or negative (in the past). BeDurations are immutable.

Methods

Name Description
minus(other: BeDuration): BeDuration Subtract a BeDuration from this BeDuration, returning a new BeDuration.  
plus(other: BeDuration): BeDuration Add a BeDuration to this BeDuration, returning a new BeDuration  
fromMilliseconds(milliseconds: number): BeDuration Static Create a BeDuration from milliseconds.  
fromSeconds(seconds: number): BeDuration Static Create a BeDuration from seconds.  
wait(ms: number): Promise<void> Static Utility function to just wait for the specified time  

Properties

Name Type Description
isTowardsFuture Accessor ReadOnly boolean Determine whether this BeDuration is towards the future  
isTowardsPast Accessor ReadOnly boolean Determine whether this BeDuration is towards the past  
isZero Accessor ReadOnly boolean Determine whether this BeDuration is 0 seconds  
milliseconds Accessor ReadOnly number The duration in milliseconds  
seconds Accessor ReadOnly number    

Defined in

Last Updated: 20 September, 2019