26#if ! defined (octave_oct_time_h)
27#define octave_oct_time_h 1
29#include "octave-config.h"
36as_double (OCTAVE_TIME_T sec,
long usec)
42 return (
static_cast<double> (sec) +
static_cast<double> (usec) / 1.0e6);
55 : m_ot_unix_time (0), m_ot_usec (0) {
stamp (); }
58 : m_ot_unix_time (t), m_ot_usec (0) { }
60 time (OCTAVE_TIME_T t,
long us)
61 : m_ot_unix_time (t), m_ot_usec ()
68 extra = (us -
rem) / 1000000;
74 extra = - (1 + (us -
rem) / 1000000);
75 rem = 1000000 - us % 1000000;
79 m_ot_unix_time += extra;
87 : m_ot_unix_time (ot.m_ot_unix_time), m_ot_usec (ot.m_ot_usec) { }
93 m_ot_unix_time = ot.m_ot_unix_time;
94 m_ot_usec = ot.m_ot_usec;
106 return as_double (m_ot_unix_time, m_ot_usec);
109 OCTAVE_TIME_T
unix_time ()
const {
return m_ot_unix_time; }
111 long usec ()
const {
return m_ot_usec; }
120 OCTAVE_TIME_T m_ot_unix_time;
154 return (t1 < t2 || t1 == t2);
173 return (t1 > t2 || t1 == t2);
252 {
return strftime (
"%a %b %d %H:%M:%S %Y\n"); }
331 OCTAVE_DEFAULT_COPY_MOVE_DELETE (
gmtime)
344 strptime (
const std::string& str,
const std::string& fmt)
350 OCTAVE_DEFAULT_COPY_MOVE_DELETE (
strptime)
358 OCTAVE_API void init (
const std::string& str,
const std::string& fmt);
368 : m_usr_sec (0), m_sys_sec (0), m_usr_usec (0), m_sys_usec (0)
373 OCTAVE_DEFAULT_COPY_MOVE_DELETE (
cpu_time)
379 return as_double (m_usr_sec, m_usr_usec);
384 return as_double (m_sys_sec, m_sys_usec);
387 OCTAVE_TIME_T
user_sec ()
const {
return m_usr_sec; }
395 OCTAVE_TIME_T m_usr_sec;
396 OCTAVE_TIME_T m_sys_sec;
401 cpu_time (OCTAVE_TIME_T usr_sec, OCTAVE_TIME_T sys_sec,
long usr_usec,
long sys_usec)
402 : m_usr_sec (usr_sec), m_sys_sec (sys_sec),
403 m_usr_usec (usr_usec), m_sys_usec (sys_usec)
412 : m_cpu (), m_maxrss (0), m_ixrss (0), m_idrss (0),
413 m_isrss (0), m_minflt (0), m_majflt (0), m_nswap (0),
414 m_inblock (0), m_oublock (0), m_msgsnd (0), m_msgrcv (0),
415 m_nsignals (0), m_nvcsw (0), m_nivcsw (0)
426 long maxrss ()
const {
return m_maxrss; }
427 long ixrss ()
const {
return m_ixrss; }
428 long idrss ()
const {
return m_idrss; }
429 long isrss ()
const {
return m_isrss; }
430 long minflt ()
const {
return m_minflt; }
431 long majflt ()
const {
return m_majflt; }
432 long nswap ()
const {
return m_nswap; }
435 long msgsnd ()
const {
return m_msgsnd; }
436 long msgrcv ()
const {
return m_msgrcv; }
438 long nvcsw ()
const {
return m_nvcsw; }
439 long nivcsw ()
const {
return m_nivcsw; }
492#if defined (OCTAVE_USE_WINDOWS_API)
494 static OCTAVE_TIME_T time_resolution = 20000000;
497 static OCTAVE_TIME_T time_resolution = 1;
499 return time_resolution;
511 return ! (*
this == t2);
523 return (*
this < t2 || *
this == t2);
535 return (*
this > t2 || *
this == t2);
550 OCTAVE_TIME_T
time ()
const {
return m_time; }
557 OCTAVE_TIME_T m_time;
560OCTAVE_END_NAMESPACE(sys)
561OCTAVE_END_NAMESPACE(octave)
ComplexColumnVector operator+(const ComplexColumnVector &x)
base_tm & operator=(const base_tm &tm)
std::string asctime() const
virtual ~base_tm()=default
std::string strftime(const std::string &fmt) const
base_tm(const base_tm &tm)
OCTAVE_TIME_T user_sec() const
OCTAVE_TIME_T system_sec() const
static file_time time_resolution()
OCTAVE_TIME_T time() const
file_time(const file_time &ot)
file_time(OCTAVE_TIME_T t)
localtime(const localtime &t)
localtime & operator=(const localtime &t)
localtime(const time &ot)
int characters_converted() const
strptime(const std::string &str, const std::string &fmt)
time(OCTAVE_TIME_T t, long us)
time & operator=(const time &ot)
friend std::ostream & operator<<(std::ostream &os, const time &ot)
std::string ctime() const
OCTAVE_TIME_T unix_time() const
double double_value() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
bool operator!=(const dim_vector &a, const dim_vector &b)
bool operator==(const dim_vector &a, const dim_vector &b)
bool operator!=(const time &t1, const time &t2)
bool operator==(const time &t1, const time &t2)
time operator+(const time &t1, const time &t2)
bool operator>=(const time &t1, const time &t2)
bool operator<(const time &t1, const time &t2)
bool operator<=(const time &t1, const time &t2)
bool operator>(const time &t1, const time &t2)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d