Time.Sleeper

class · namespace z3n7 · source Essentials/Time.cs

public class Sleeper

Random pause within a fixed range.

Constructors

Sleeper

public Sleeper(int min, int max)

source

Creates a sleeper for pauses of min … max milliseconds, both inclusive.

Parameter Description
min Minimum, ms. Must not be negative.
max Maximum, ms. Must not be less than min.

Methods

Sleep

public void Sleep(double multiplier = 1.0)

source

Blocks the thread for a random time within the range.

Parameter Description
multiplier Scale factor for the pause, e.g. 2.0 waits twice as long.