class Poco::Stopwatch

Overview

A simple facility to measure time intervals with microsecond resolution. Moreā€¦

#include <Stopwatch.h>

class Stopwatch
{
public:
    // methods

    void
    start();

    void
    stop();

    void
    reset();

    void
    restart();

    Clock::ClockDiff
    elapsed() const;

    int
    elapsedSeconds() const;

    static
    Clock::ClockVal
    resolution();
};

Detailed Documentation

A simple facility to measure time intervals with microsecond resolution.

Methods

void
start()

Starts (or restarts) the stopwatch.

void
stop()

Stops or pauses the stopwatch.

void
reset()

Resets the stopwatch.

void
restart()

Resets and starts the stopwatch.

Clock::ClockDiff
elapsed() const

Returns the elapsed time in microseconds since the stopwatch started.

int
elapsedSeconds() const

Returns the number of seconds elapsed since the stopwatch started.

static
Clock::ClockVal
resolution()

Returns the resolution of the stopwatch.