System::Diagnostics::Stopwatch class

Stopwatch class

Allows time measurement. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class Stopwatch : public System::Object

Methods

MethodDescription
get_Elapsed() constGets the total elapsed time measured by the current instance.
get_ElapsedMilliseconds() constGets the total elapsed time measured by the current instance, in milliseconds.
get_ElapsedTicks() constGets the total elapsed time measured by the current instance, in timer ticks.
get_IsRunning() constChecks if stopwatch is running.
Reset()Stops time measurement, sets measured interval to zero.
Restart()Sets measured interval to zero, then starts time measurement.
Start()Starts time measurement.
static StartNew()Creates new Stopwatch object and starts measurement.
Stop()Stops time measurement.
Stopwatch()RTTI information.
virtual ~Stopwatch()Destructor.

See Also