Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::StopWatch Class Reference

#include <base_types.h>

Public Member Functions

 StopWatch (absl::Duration *duration)
 ~StopWatch ()
double elapsed_time_in_seconds () const
absl::Duration GetElapsedDuration () const

Detailed Description

Simple stopwatch class that enables recording the time spent in various functions in the code. It uses RAII to automatically record the time spent in the constructor and destructor, independently of the path taken by the code.

Definition at line 384 of file base_types.h.

Constructor & Destructor Documentation

◆ StopWatch()

operations_research::StopWatch::StopWatch ( absl::Duration * duration)
inlineexplicit

Definition at line 386 of file base_types.h.

◆ ~StopWatch()

operations_research::StopWatch::~StopWatch ( )
inline

Definition at line 389 of file base_types.h.

Member Function Documentation

◆ elapsed_time_in_seconds()

double operations_research::StopWatch::elapsed_time_in_seconds ( ) const
inline

Returns the elapsed time in seconds at a given moment. To be use to implement time limits in the derived classes.

Definition at line 395 of file base_types.h.

◆ GetElapsedDuration()

absl::Duration operations_research::StopWatch::GetElapsedDuration ( ) const
inline

Definition at line 397 of file base_types.h.


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