Bimetric 3+1 toolkit for spherical symmetry
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TrackUsedTime Class Reference

Reports the elapsed time for the lifetime of the created object. More...

#include <trackUsedTime.h>

Public Member Functions

 TrackUsedTime ()
 ~TrackUsedTime ()

Private Attributes

time_hr rt_born
 The realtime when the object was created.

Detailed Description

Reports the elapsed time for the lifetime of the created object.

Definition at line 16 of file trackUsedTime.h.


Constructor & Destructor Documentation

Definition at line 22 of file trackUsedTime.h.

    {
        rt_born = std::chrono::high_resolution_clock::now ();
    }

Definition at line 27 of file trackUsedTime.h.

    {
        slog << "*** Elapsed: ";
        auto end = std::chrono::high_resolution_clock::now ();
        auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>
                       ( end - rt_born ).count ();
        if ( elapsed < 1e3 ) {
            slog << elapsed << " ms" << std::endl;
        }
        else {
            slog << std::setprecision(3) << 1e-3 * elapsed << " s" << std::endl;
        }
    }

Field Documentation

The realtime when the object was created.

Definition at line 18 of file trackUsedTime.h.


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