Skip to content

Commit

Permalink
Update documentation to include timer class
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysgoldstein committed Jul 4, 2019
1 parent 9df3eaf commit 9b53323
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This folder contains generic classes that may be useful for a variety of applica
- [`qualified_type`](src/sydevs/core/qualified_type.h): Traits for data types that can be passed among system nodes.
- [`pointer`](src/sydevs/core/pointer.h) (related class): Points to any type of data.
- [`string_builder`](src/sydevs/core/string_builder.h) (related class): Faciliates value-to-string conversions.
- [`timer`](src/sydevs/core/timer.h): Measures intervals of wall clock time.

#### [`src/sydevs/time`](src/sydevs/time)

Expand Down
23 changes: 11 additions & 12 deletions src/sydevs/core/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,25 @@ using clock_time = std::chrono::time_point<clock>;


/**
* @brief Text.
* @brief A class for measuring and accumulating intervals of wallclock time.
*
* @details
* Text.
* A `timer` object measures the interval of wallclock time that elapses between
* the point at which it is started and the point at which it is stopped. It
* also accumulates these time intervals. It can be used to measure how much
* is spent executing a block of code. All wallclock time durations are measured
* and reported in microseconds.
*/
class timer
{
public:
/**
* @brief Constructs a `timer` instance.
* @brief Constructs a timer that has not yet accumuated any interval measurements.
*/
timer();

/**
* @brief Constructs a `timer` instance...
*
* @details
* Text.
*
* @param cumulative_dt Text.
* @brief Constructs a timer that initially has a cumulative duration of `cumulative_dt`.
*/
explicit timer(duration cumulative_dt);

Expand All @@ -43,10 +42,10 @@ class timer

bool timing() const;

duration cumulative_duration() const; ///< Returns the cumulative duration.
duration cumulative_duration() const; ///< Returns the cumulative duration of measured time.

void start();
duration stop();
void start(); ///< Starts the timer.
duration stop(); ///< Stops the timer and returns the measured interval of wallclock time.

private:
clock_time start_clk_t_;
Expand Down
1 change: 1 addition & 0 deletions src/sydevs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Namespace: [sydevs](@ref sydevs)
* [qualified_type](@ref sydevs::qualified_type) ([qualified_type.h](@ref sydevs/core/qualified_type.h)) - traits for types exchanged between system nodes
* [pointer](@ref sydevs::pointer) ([pointer.h](@ref sydevs/core/pointer.h)) - related class for pointers to any type of data
* [string_builder](@ref sydevs::string_builder) ([string_builder.h](@ref sydevs/core/string_builder.h)) - related class for value-to-string conversion
* [timer](@ref sydevs::timer) ([timer.h](@ref sydevs/core/timer.h)) - class that measures intervals of wall clock time

- Time Classes ([sydevs](@ref src/sydevs)/[time](@ref src/sydevs/time)) - multiscale time representation
* [time_point](@ref sydevs::time_point) ([time_point.h](@ref sydevs/time/time_point.h)) - arbitrary-precision point in time
Expand Down

0 comments on commit 9b53323

Please sign in to comment.