STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Functions
chrono File Reference
#include <limits>
#include <ratio>
#include <utility>
#include <time.h>
#include <thr/xtimec.h>

Classes

struct  chrono::treat_as_floating_point< _Rep >
 
struct  chrono::duration_values< _Rep >
 
struct  chrono::_Is_ratio< _Ty >
 
struct  chrono::_Is_ratio< ratio< _R1, _R2 > >
 
class  chrono::duration< _Rep, _Period >
 
struct  chrono::_Is_duration< _Ty >
 
class  chrono::duration< _Rep, _Period >
 
class  chrono::duration< duration< _Rep1, _Period1 >, _Period2 >
 
struct  chrono::_Is_duration< duration< _Rep, _Period > >
 
class  chrono::time_point< _Clock, _Duration >
 
struct  _Lcm< _Ax, _Bx >
 
struct  common_type< chrono::duration< _Rep1, _Period1 >, chrono::duration< _Rep2, _Period2 > >
 
struct  common_type< chrono::time_point< _Clock, _Duration1 >, chrono::time_point< _Clock, _Duration2 > >
 
struct  chrono::system_clock
 
class  chrono::steady_clock
 

Namespaces

 chrono
 

Macros

#define _CHRONO_
 

Typedefs

typedef duration< long long, nanochrono::nanoseconds
 
typedef duration< long long, microchrono::microseconds
 
typedef duration< long long, millichrono::milliseconds
 
typedef duration< long long > chrono::seconds
 
typedef duration< int, ratio< 60 > > chrono::minutes
 
typedef duration< int, ratio< 3600 > > chrono::hours
 
typedef steady_clock chrono::monotonic_clock
 
typedef system_clock chrono::high_resolution_clock
 

Functions

template<class _To , class _Rep , class _Period >
enable_if< _Is_duration< _To >::value, _To >::type chrono::duration_cast (const duration< _Rep, _Period > &)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type chrono::operator+ (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type chrono::operator- (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
enable_if< is_convertible< _Rep2, typename common_type< _Rep1, _Rep2 >::type >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period1 > >::type chrono::operator* (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Rep2 , class _Period2 >
enable_if< is_convertible< _Rep1, typename common_type< _Rep1, _Rep2 >::type >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period2 > >::type chrono::operator* (const _Rep1 &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
enable_if< is_convertible< _Rep2, typename common_type< _Rep1, _Rep2 >::type >::value &&!_Is_duration< _Rep2 >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period1 > >::type chrono::operator/ (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
common_type< _Rep1, _Rep2 >::type chrono::operator/ (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
enable_if< is_convertible< _Rep2, typename common_type< _Rep1, _Rep2 >::type >::value &&!_Is_duration< _Rep2 >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period1 > >::type chrono::operator% (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
common_type< _Rep1, _Rep2 >::type chrono::operator% (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator== (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator!= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator< (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator<= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator> (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
bool chrono::operator>= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Clock , class _Duration , class _Rep , class _Period >
time_point< _Clock, typename common_type< _Duration, duration< _Rep, _Period > >::type > chrono::operator+ (const time_point< _Clock, _Duration > &_Left, const duration< _Rep, _Period > &_Right)
 
template<class _Rep , class _Period , class _Clock , class _Duration >
time_point< _Clock, typename common_type< duration< _Rep, _Period >, _Duration >::type > chrono::operator+ (const duration< _Rep, _Period > &_Left, const time_point< _Clock, _Duration > &_Right)
 
template<class _Clock , class _Duration , class _Rep , class _Period >
time_point< _Clock, typename common_type< _Duration, duration< _Rep, _Period > >::type > chrono::operator- (const time_point< _Clock, _Duration > &_Left, const duration< _Rep, _Period > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
common_type< _Duration1, _Duration2 >::type chrono::operator- (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator== (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator!= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator< (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator<= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator> (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
bool chrono::operator>= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _To , class _Clock , class _Duration >
enable_if< _Is_duration< _To >::value, time_point< _Clock, _To > >::type chrono::time_point_cast (const time_point< _Clock, _Duration > &_Time)
 
template<class _Rep , class _Period >
xtime _To_xtime (const chrono::duration< _Rep, _Period > &_Rel_time)
 

Macro Definition Documentation

#define _CHRONO_

Function Documentation

template<class _Rep , class _Period >
xtime _To_xtime ( const chrono::duration< _Rep, _Period > &  _Rel_time)
inline
737  { // convert duration to xtime
738  xtime _Xt;
739  if (_Rel_time <= chrono::duration<_Rep, _Period>::zero())
740  { // negative or zero relative time, return zero
741  _Xt.sec = 0;
742  _Xt.nsec = 0;
743  }
744  else
745  { // positive relative time, convert
746  chrono::nanoseconds _T0 =
748  _T0 += _Rel_time;
750  _T0 -= chrono::seconds(_Xt.sec);
751  _Xt.nsec = (long)_T0.count();
752  }
753  return (_Xt);
754  }
Definition: chrono:65
iterator_traits< _InIt >::difference_type count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3086
static time_point now() _NOEXCEPT
Definition: chrono:703
_Duration time_since_epoch() const
Definition: chrono:271
enable_if< _Is_duration< _To >::value, _To >::type duration_cast(const duration< _Rep, _Period > &)
Definition: chrono:535
Definition: xtimec.h:22
time_t sec
Definition: xtimec.h:24
long nsec
Definition: xtimec.h:25
_Rep count() const
Definition: chrono:129
duration< long long > seconds
Definition: chrono:558