Into

Modules

Documentation

classPiiTimer

#include <PiiTimer.h>

PiiTimer uses QTime to achieve microsecond-resolution timing of intervals.

Description

The functionality is almost equal to QTime, but this class provides microsecond-resolution timing (on systems that support such resolution) and adds a stop() function that can be used to stop counting.

Constructors and destructor

( )
( )

Constructs a new timer that is initialized to the system's current time.

( )

Public member functions

qint64

Returns the time elapsed from the construction of this object or the previous restart() call, whichever is later.

qint64

Returns the elapsed time in milliseconds.

( )
qint64
( )

Restarts counting.

double
( )

Returns the elapsed time in seconds.

void
( )

Stops counting.

Function details

  • PiiTimer

    ( )
  • PiiTimer

    ()

    Constructs a new timer that is initialized to the system's current time.

    The timer starts counting automatically.

  • ~PiiTimer

    ()
  • qint64 microseconds

    ()

    Returns the time elapsed from the construction of this object or the previous restart() call, whichever is later.

    Time is measured in microseconds. If the timer is stopped, returns 0.

  • qint64 milliseconds

    ()

    Returns the elapsed time in milliseconds.

  • PiiTimer & operator=

    ( )
  • qint64 restart

    ()

    Restarts counting.

    Returns the number of microseconds elapsed since the last restart or construction of the object, whichever is later.

  • double seconds

    ()

    Returns the elapsed time in seconds.

  • void stop

    ()

    Stops counting.

    When the timer is stopped, elapsed time is always 0. One needs to call restart() to restart counting.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.