C# Class LitDev.LDStopwatch

Datei anzeigen Open project: litdev1/LitDev

Public Methods

Method Description
Add ( ) : Primitive

Create a new stopwatch.

DelayUpTo ( Primitive delay ) : void

Delay up to a maximum interval since the last time this is called. Useful in a game loop to maintain an even play speed.

ElapsedMilliseconds ( Primitive stopwatch ) : Primitive

Gets the total elapsed time measured in milliseconds.

ElapsedTicks ( Primitive stopwatch ) : Primitive

Gets the total elapsed time measured in timer ticks for very short intervals.

Reset ( Primitive stopwatch ) : void

Stops the current stopwatch and resets the elapsed time to 0.

Restart ( Primitive stopwatch ) : void

Stops the current stopwatch, resets the elapsed time to 0 and restarts the stopwatch.

Start ( Primitive stopwatch ) : void

Starts or resumes the current stopwatch.

Stop ( Primitive stopwatch ) : void

Stops the current stopwatch.

Private Methods

Method Description
GetNewWatch ( ) : string

Method Details

Add() public static method

Create a new stopwatch.
public static Add ( ) : Primitive
return Primitive

DelayUpTo() public static method

Delay up to a maximum interval since the last time this is called. Useful in a game loop to maintain an even play speed.
public static DelayUpTo ( Primitive delay ) : void
delay Primitive The maximum delay in ms.
return void

ElapsedMilliseconds() public static method

Gets the total elapsed time measured in milliseconds.
public static ElapsedMilliseconds ( Primitive stopwatch ) : Primitive
stopwatch Primitive The stopwatch name.
return Primitive

ElapsedTicks() public static method

Gets the total elapsed time measured in timer ticks for very short intervals.
public static ElapsedTicks ( Primitive stopwatch ) : Primitive
stopwatch Primitive The stopwatch name.
return Primitive

Reset() public static method

Stops the current stopwatch and resets the elapsed time to 0.
public static Reset ( Primitive stopwatch ) : void
stopwatch Primitive The stopwatch name.
return void

Restart() public static method

Stops the current stopwatch, resets the elapsed time to 0 and restarts the stopwatch.
public static Restart ( Primitive stopwatch ) : void
stopwatch Primitive The stopwatch name.
return void

Start() public static method

Starts or resumes the current stopwatch.
public static Start ( Primitive stopwatch ) : void
stopwatch Primitive The stopwatch name.
return void

Stop() public static method

Stops the current stopwatch.
public static Stop ( Primitive stopwatch ) : void
stopwatch Primitive The stopwatch name.
return void