Show / Hide Table of Contents

Struct Seconds

Used with wait functions. Contains a wait timeout in seconds, and possibly wait options.

public struct Seconds
Remarks

Many wait functions of this library internally use WaitLoop. They have a timeout parameter of Seconds type which allows to pass timeout and more options to WaitLoop in single parameter. You can pass a Seconds variable, like new(3, period: 5). If don't need options etc, you can pass just timeout, like 3 or 0.5.

Other wait functions have a timeout parameter of Seconds type but instead of WaitLoop use various hooks, events, Windows wait API, etc. They support only these Seconds properties: Time, Cancel, maybe DoEvents. Some always work like with DoEventstrue.

More info: Wait timeout.

Examples
var w = wnd.find(new Seconds(3) { Period = 5, MaxPeriod = 50 }, "Name");
var to = new Seconds(0) { MaxPeriod = 50 };
wait.until(to, () => keys.isCtrl );
wait.until(to with { Time = 30 }, () => keys.isCtrl );

Namespace: Au.Types
Assembly: Au.dll

Constructors

Name Description
Seconds(double)

Sets timeout. Example: var w = wnd.find(new Seconds(3) { Period = 5, MaxPeriod = 50 }, "Name");.

Properties

Name Description
Cancel

Can be used to cancel the wait operation.

DoEvents

Use wait.doEvents instead of wait.ms. If null, will be used false.

MaxPeriod

Sets WaitLoop.MaxPeriod. If null (default), it will use Period*50.

Period

The sleep time between checking the wait condition periodically. Milliseconds. If null, will be used a value that usually is best for that wait function, in most cases 10.

Time

Timeout, in seconds. Negative value means "don't throw exception when timed out". Value 0 means "wait indefinitely" when used with WaitX functions; with FindX functions it means "don't wait". More info: Wait timeout.

Operators

Name Description
implicit operator Seconds(double)