Category talk:Wren-date: Difference between revisions

→‎Source code: Added a 'wait' method to the Duration class.
(→‎Source code: Changed Date.fromNum_ from a private to a public constructor.)
(→‎Source code: Added a 'wait' method to the Duration class.)
Line 702:
// Maximum safe integer (2^53 - 1) and hence duration
static maximum { 9007199254740991 }
 
// Blocks the current fiber for a given number of milliseconds.
static wait(ms) {
if (ms.type != Num || ms < 0) {
Fiber.abort("Argument must be a non-negative number of milliseconds.")
}
var finish = System.clock + ms/1000
while (System.clock <= finish) {}
}
 
// Constructs a new Duration object by passing it a number (positive or negative) of:
9,476

edits