JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JStopWatch Class Reference

#include <JStopWatch.h>

Public Member Functions

 JStopWatch ()
 
 ~JStopWatch ()
 
void StartTimer ()
 
void StopTimer ()
 
JFloat GetCPUTimeInterval () const
 
JFloat GetUserTimeInterval () const
 
JString PrintTimeInterval () const
 

Detailed Description

Class for timing an operation.

Typical usage:

    #include "JStopWatch.h"
    ...
    JStopWatch timer;
    timer.StartTimer();
    ...
    timer.StopTimer();
    JString duration = timer.PrintTimeInterval();

This class was not designed to be a base class.

Constructor & Destructor Documentation

◆ JStopWatch()

JStopWatch::JStopWatch ( )

◆ ~JStopWatch()

JStopWatch::~JStopWatch ( )

Member Function Documentation

◆ GetCPUTimeInterval()

JFloat JStopWatch::GetCPUTimeInterval ( ) const

Return the time interval in seconds from clock.

If we are still running, then we return the amount of time since we started.

◆ GetUserTimeInterval()

JFloat JStopWatch::GetUserTimeInterval ( ) const

Return the time interval in seconds from time.

If we are still running, then we return the amount of time since we started.

◆ PrintTimeInterval()

JString JStopWatch::PrintTimeInterval ( ) const

Return the time interval as a text string: "<cpu time>; <user time>"

◆ StartTimer()

void JStopWatch::StartTimer ( )

◆ StopTimer()

void JStopWatch::StopTimer ( )

The documentation for this class was generated from the following files: