RUSH
Reusable Utilities in Single Headers is a collection of header-only utilities for C++
Loading...
Searching...
No Matches
chrono.hpp File Reference

This library provides chrono utilities. More...

#include <chrono>
#include <iostream>
#include <ratio>
#include <string>
#include <thread>
#include <utility>

Go to the source code of this file.

Classes

class  rush::chrono::Chrono< T >
 A simple chrono class to measure elapsed time. More...
 
class  rush::chrono::Chronometer< T >
 A chrono class that automatically prints elapsed time. More...
 

Typedefs

using rush::chrono::ns = std::nano
 Convenience alias for nanoseconds.
 
using rush::chrono::us = std::micro
 Convenience alias for microseconds.
 
using rush::chrono::ms = std::milli
 Convenience alias for milliseconds.
 
using rush::chrono::s = std::ratio<1>
 Convenience alias for seconds.
 
using rush::chrono::min = std::ratio<60>
 Convenience alias for minutes.
 
using rush::chrono::hour = std::ratio<3600>
 Convenience alias for hours.
 
using rush::chrono::day = std::ratio<86400>
 Convenience alias for days.
 

Functions

template<typename T = s>
void rush::chrono::sleep (double t)
 Sleep for the specified duration.
 

Detailed Description

This library provides chrono utilities.

Author
Raul Tapia (raultapia.com)
See also
https://github.com/raultapia/rush

Function Documentation

◆ sleep()

template<typename T = s>
void rush::chrono::sleep ( double t)
inline

Sleep for the specified duration.

Template Parameters
TUnit of time (default to seconds).
Parameters
tThe duration.