Delay

Description

An opaque awaitable type, specifically used in coroutines, representing an abstract delay time.

await Delay(5); // awaits 5 model time units
var delay = Delay.seconds(22); // represents a 22 second delay
await delay; // wait for 22 seconds
await delay; // wait again for another 22 seconds
		

A Delay represents an 'abstract' delay time in that the suspend/resume mechanism is not started when the Delay object is created, but each time the await statement is invoked, resulting in possibly multiple different delay actions.

Constructor

Delay Returns a delay object representing a delay time in model time units.

Static Methods

days Returns a delay object representing a delay time in days.
hours Returns a delay object representing a delay time in hours.
minutes Returns a delay object representing a delay time in minutes.
seconds Returns a delay object representing a delay time in seconds.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

Delay Constructor

Delay( double timeUnits )

Parameters

timeUnits The number of model time units to delay.

Returns

Delay The resulting delay.

Description

Returns a delay object representing a delay time in model time units.

await Delay(5);
Do no remove, this fixes the anchor on doc.flexsim.com

Delay.days()

static Delay days( double numDays )

Parameters

numDays The number of days to delay.

Returns

Delay The resulting delay.

Description

Returns a delay object representing a delay time in days.

await Delay.days(5);
Do no remove, this fixes the anchor on doc.flexsim.com

Delay.hours()

static Delay hours( double numHours )

Parameters

numHours The number of hours to delay.

Returns

Delay The resulting delay.

Description

Returns a delay object representing a delay time in hours.

await Delay.hours(5);
Do no remove, this fixes the anchor on doc.flexsim.com

Delay.minutes()

static Delay minutes( double numMinutes )

Parameters

numMinutes The number of minutes to delay.

Returns

Delay The resulting delay.

Description

Returns a delay object representing a delay time in minutes.

await Delay.minutes(5);
Do no remove, this fixes the anchor on doc.flexsim.com

Delay.seconds()

static Delay seconds( double numSeconds )

Parameters

numSeconds The number of seconds to delay.

Returns

Delay The resulting delay.

Description

Returns a delay object representing a delay time in seconds.

await Delay.seconds(5);