CppTools
Loading...
Searching...
No Matches
Time.hpp File Reference

Contains useful set of functions to print current time, time duration. More...

#include <ctime>
#include <chrono>
#include <iostream>

Go to the source code of this file.

Typedefs

typedef std::chrono::_V2::system_clock::time_point chrono_t

Functions

chrono_t CppTools::GetCurrentTime ()
 Returns current time as std::chrono::_V2::system_clock::time_point (or chrono_t).
void CppTools::PrintCurrentTime ()
 Prints current time in format: Week Month Hour:Minute:Second Year.
void CppTools::PrintTimeDuration (const std::chrono::_V2::system_clock::time_point start, const std::chrono::_V2::system_clock::time_point stop)
 Prints the time duration converted from 2 chrono_t variables. These chrono_t variables can be acquired with the use of chrono_t CppTools::GetCurrentTime function. If the both variables were acquired as a current time measurement in 2 different points in time then the returned duration is the time duration between these 2 different points in time.

Detailed Description

Contains useful set of functions to print current time, time duration.

In order to use these functions libTime.so must be loaded

This file is a part of a project CppTools (https://github.com/Sergeyir/CppTools).

Author
Sergei Antsupov (antsu.nosp@m.pov0.nosp@m.124@g.nosp@m.mail.nosp@m..com)

Function Documentation

◆ GetCurrentTime()

chrono_t CppTools::GetCurrentTime ( )

Returns current time as std::chrono::_V2::system_clock::time_point (or chrono_t).

Parameters
[out]currentTimechrono_t variable

◆ PrintTimeDuration()

void CppTools::PrintTimeDuration ( const std::chrono::_V2::system_clock::time_point start,
const std::chrono::_V2::system_clock::time_point stop )

Prints the time duration converted from 2 chrono_t variables. These chrono_t variables can be acquired with the use of chrono_t CppTools::GetCurrentTime function. If the both variables were acquired as a current time measurement in 2 different points in time then the returned duration is the time duration between these 2 different points in time.

Parameters
[in]startfirst chrono_t variable
[in]stopsecond chrono_t variable