A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
nstime.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef TIME_H
21 #define TIME_H
22 
23 #include "assert.h"
24 #include "attribute.h"
25 #include "attribute-helper.h"
26 #include "int64x64.h"
27 #include "unused.h"
28 #include <stdint.h>
29 #include <limits>
30 #include <cmath>
31 #include <ostream>
32 #include <set>
33 
34 namespace ns3 {
35 
81 class Time
82 {
83 public:
87  enum Unit
88  {
89  Y = 0,
90  D = 1,
91  H = 2,
92  MIN = 3,
93  S = 4,
94  MS = 5,
95  US = 6,
96  NS = 7,
97  PS = 8,
98  FS = 9,
99  LAST = 10
100  };
101 
102  inline Time &operator = (const Time &o)
103  {
104  m_data = o.m_data;
105  return *this;
106  }
107  inline Time ()
108  : m_data ()
109  {
110  if (g_markingTimes)
111  {
112  Mark (this);
113  }
114  }
115  inline Time(const Time &o)
116  : m_data (o.m_data)
117  {
118  if (g_markingTimes)
119  {
120  Mark (this);
121  }
122  }
123  explicit inline Time (double v)
124  : m_data (lround (v))
125  {
126  if (g_markingTimes)
127  {
128  Mark (this);
129  }
130  }
131  explicit inline Time (int v)
132  : m_data (v)
133  {
134  if (g_markingTimes)
135  {
136  Mark (this);
137  }
138  }
139  explicit inline Time (long int v)
140  : m_data (v)
141  {
142  if (g_markingTimes)
143  {
144  Mark (this);
145  }
146  }
147  explicit inline Time (long long int v)
148  : m_data (v)
149  {
150  if (g_markingTimes)
151  {
152  Mark (this);
153  }
154  }
155  explicit inline Time (unsigned int v)
156  : m_data (v)
157  {
158  if (g_markingTimes)
159  {
160  Mark (this);
161  }
162  }
163  explicit inline Time (unsigned long int v)
164  : m_data (v)
165  {
166  if (g_markingTimes)
167  {
168  Mark (this);
169  }
170  }
171  explicit inline Time (unsigned long long int v)
172  : m_data (v)
173  {
174  if (g_markingTimes)
175  {
176  Mark (this);
177  }
178  }
199  explicit Time (const std::string & s);
200 
204  static Time Min ()
205  {
206  return Time (std::numeric_limits<int64_t>::min ());
207  }
211  static Time Max ()
212  {
213  return Time (std::numeric_limits<int64_t>::max ());
214  }
215 
219  ~Time ()
220  {
221  if (g_markingTimes)
222  {
223  Clear (this);
224  }
225  }
226 
230  inline bool IsZero (void) const
231  {
232  return m_data == 0;
233  }
237  inline bool IsNegative (void) const
238  {
239  return m_data <= 0;
240  }
244  inline bool IsPositive (void) const
245  {
246  return m_data >= 0;
247  }
251  inline bool IsStrictlyNegative (void) const
252  {
253  return m_data < 0;
254  }
258  inline bool IsStrictlyPositive (void) const
259  {
260  return m_data > 0;
261  }
265  inline int Compare (const Time &o) const
266  {
267  return (m_data < o.m_data) ? -1 : (m_data == o.m_data) ? 0 : 1;
268  }
269 
274  inline double GetSeconds (void) const
275  {
276  return ToDouble (Time::S);
277  }
278 
283  inline int64_t GetMilliSeconds (void) const
284  {
285  return ToInteger (Time::MS);
286  }
291  inline int64_t GetMicroSeconds (void) const
292  {
293  return ToInteger (Time::US);
294  }
299  inline int64_t GetNanoSeconds (void) const
300  {
301  return ToInteger (Time::NS);
302  }
307  inline int64_t GetPicoSeconds (void) const
308  {
309  return ToInteger (Time::PS);
310  }
315  inline int64_t GetFemtoSeconds (void) const
316  {
317  return ToInteger (Time::FS);
318  }
319 
324  inline double GetMinutes (void) const
325  {
326  return ToDouble (Time::MIN);
327  }
332  inline double GetHours (void) const
333  {
334  return ToDouble (Time::H);
335  }
340  inline double GetDays (void) const
341  {
342  return ToDouble (Time::D);
343  }
348  inline double GetYears (void) const
349  {
350  return ToDouble (Time::Y);
351  }
352 
356  inline int64_t GetTimeStep (void) const
357  {
358  return m_data;
359  }
360  inline double GetDouble (void) const
361  {
362  return m_data;
363  }
364  inline int64_t GetInteger (void) const
365  {
366  return GetTimeStep ();
367  }
368 
369 
377  static void SetResolution (enum Unit resolution);
381  static enum Unit GetResolution (void);
392  inline static Time FromInteger (uint64_t value, enum Unit timeUnit)
393  {
394  struct Information *info = PeekInformation (timeUnit);
395  if (info->fromMul)
396  {
397  value *= info->factor;
398  }
399  else
400  {
401  value /= info->factor;
402  }
403  return Time (value);
404  }
412  inline int64_t ToInteger (enum Unit timeUnit) const
413  {
414  struct Information *info = PeekInformation (timeUnit);
415  int64_t v = m_data;
416  if (info->toMul)
417  {
418  v *= info->factor;
419  }
420  else
421  {
422  v /= info->factor;
423  }
424  return v;
425  }
433  inline static Time FromDouble (double value, enum Unit timeUnit)
434  {
435  return From (int64x64_t (value), timeUnit);
436  }
444  inline double ToDouble (enum Unit timeUnit) const
445  {
446  return To (timeUnit).GetDouble ();
447  }
448  static inline Time From (const int64x64_t &from, enum Unit timeUnit)
449  {
450  struct Information *info = PeekInformation (timeUnit);
451  // DO NOT REMOVE this temporary variable. It's here
452  // to work around a compiler bug in gcc 3.4
453  int64x64_t retval = from;
454  if (info->fromMul)
455  {
456  retval *= info->timeFrom;
457  }
458  else
459  {
460  retval.MulByInvert (info->timeFrom);
461  }
462  return Time (retval);
463  }
464  inline int64x64_t To (enum Unit timeUnit) const
465  {
466  struct Information *info = PeekInformation (timeUnit);
467  int64x64_t retval = int64x64_t (m_data);
468  if (info->toMul)
469  {
470  retval *= info->timeTo;
471  }
472  else
473  {
474  retval.MulByInvert (info->timeTo);
475  }
476  return retval;
477  }
478  inline operator int64x64_t () const
479  {
480  return int64x64_t (m_data);
481  }
482  explicit inline Time (const int64x64_t &value)
483  : m_data (value.GetHigh ())
484  {
485  if (g_markingTimes)
486  {
487  Mark (this);
488  }
489  }
490  inline static Time From (const int64x64_t &value)
491  {
492  return Time (value);
493  }
494 
495 private:
499  struct Information
500  {
501  bool toMul;
502  bool fromMul;
503  int64_t factor;
504  int64x64_t timeTo;
505  int64x64_t timeFrom;
506  };
510  struct Resolution
511  {
514  };
515 
516  static inline struct Resolution *PeekResolution (void)
517  {
518  static struct Time::Resolution resolution = SetDefaultNsResolution ();
519  return &resolution;
520  }
521  static inline struct Information *PeekInformation (enum Unit timeUnit)
522  {
523  return &(PeekResolution ()->info[timeUnit]);
524  }
525 
526  static struct Resolution SetDefaultNsResolution (void);
527  static void SetResolution (enum Unit unit, struct Resolution *resolution,
528  const bool convert = true);
529 
549  typedef std::set< Time * > MarkedTimes;
565 public:
569  static bool StaticInit ();
570 private:
571 
572  /* Friend the Simulator class so it can call the private function
573  ClearMarkedTimes ()
574  */
575  friend class Simulator;
582  static void ClearMarkedTimes ();
586  static void Mark (Time * const time);
590  static void Clear (Time * const time);
594  static void ConvertTimes (const enum Unit unit);
595 
596  friend bool operator == (const Time &lhs, const Time &rhs);
597  friend bool operator != (const Time &lhs, const Time &rhs);
598  friend bool operator <= (const Time &lhs, const Time &rhs);
599  friend bool operator >= (const Time &lhs, const Time &rhs);
600  friend bool operator < (const Time &lhs, const Time &rhs);
601  friend bool operator > (const Time &lhs, const Time &rhs);
602  friend Time operator + (const Time &lhs, const Time &rhs);
603  friend Time operator - (const Time &lhs, const Time &rhs);
604  friend Time &operator += (Time &lhs, const Time &rhs);
605  friend Time &operator -= (Time &lhs, const Time &rhs);
606  friend Time Abs (const Time &time);
607  friend Time Max (const Time &ta, const Time &tb);
608  friend Time Min (const Time &ta, const Time &tb);
609 
610 
611  int64_t m_data;
612 
613 }; // class Time
614 
615 
616 // Force static initialization of Time
617 static bool NS_UNUSED_GLOBAL (g_TimeStaticInit) = Time::StaticInit ();
618 
619 inline bool
620 operator == (const Time &lhs, const Time &rhs)
621 {
622  return lhs.m_data == rhs.m_data;
623 }
624 inline bool
625 operator != (const Time &lhs, const Time &rhs)
626 {
627  return lhs.m_data != rhs.m_data;
628 }
629 inline bool
630 operator <= (const Time &lhs, const Time &rhs)
631 {
632  return lhs.m_data <= rhs.m_data;
633 }
634 inline bool
635 operator >= (const Time &lhs, const Time &rhs)
636 {
637  return lhs.m_data >= rhs.m_data;
638 }
639 inline bool
640 operator < (const Time &lhs, const Time &rhs)
641 {
642  return lhs.m_data < rhs.m_data;
643 }
644 inline bool
645 operator > (const Time &lhs, const Time &rhs)
646 {
647  return lhs.m_data > rhs.m_data;
648 }
649 inline Time operator + (const Time &lhs, const Time &rhs)
650 {
651  return Time (lhs.m_data + rhs.m_data);
652 }
653 inline Time operator - (const Time &lhs, const Time &rhs)
654 {
655  return Time (lhs.m_data - rhs.m_data);
656 }
657 inline Time &operator += (Time &lhs, const Time &rhs)
658 {
659  lhs.m_data += rhs.m_data;
660  return lhs;
661 }
662 inline Time &operator -= (Time &lhs, const Time &rhs)
663 {
664  lhs.m_data -= rhs.m_data;
665  return lhs;
666 }
667 
675 inline Time Abs (const Time &time)
676 {
677  return Time ((time.m_data < 0) ? -time.m_data : time.m_data);
678 }
686 inline Time Max (const Time &ta, const Time &tb)
687 {
688  return Time ((ta.m_data < tb.m_data) ? tb : ta);
689 }
695 inline Time Min (const Time &ta, const Time &tb)
696 {
697  return Time ((ta.m_data > tb.m_data) ? tb : ta);
698 }
699 
700 
707 std::ostream& operator<< (std::ostream& os, const Time & time);
714 std::istream& operator>> (std::istream& is, Time & time);
715 
727 inline Time Seconds (double seconds)
728 {
729  return Time::FromDouble (seconds, Time::S);
730 }
731 
743 inline Time MilliSeconds (uint64_t ms)
744 {
745  return Time::FromInteger (ms, Time::MS);
746 }
758 inline Time MicroSeconds (uint64_t us)
759 {
760  return Time::FromInteger (us, Time::US);
761 }
773 inline Time NanoSeconds (uint64_t ns)
774 {
775  return Time::FromInteger (ns, Time::NS);
776 }
788 inline Time PicoSeconds (uint64_t ps)
789 {
790  return Time::FromInteger (ps, Time::PS);
791 }
803 inline Time FemtoSeconds (uint64_t fs)
804 {
805  return Time::FromInteger (fs, Time::FS);
806 }
818 inline Time Minutes (double minutes)
819 {
820  return Time::FromDouble (minutes, Time::MIN);
821 }
833 inline Time Hours (double hours)
834 {
835  return Time::FromDouble (hours, Time::H);
836 }
848 inline Time Days (double days)
849 {
850  return Time::FromDouble (days, Time::D);
851 }
863 inline Time Years (double years)
864 {
865  return Time::FromDouble (years, Time::Y);
866 }
867 
872 inline Time Seconds (int64x64_t seconds)
873 {
874  return Time::From (seconds, Time::S);
875 }
880 inline Time MilliSeconds (int64x64_t ms)
881 {
882  return Time::From (ms, Time::MS);
883 }
888 inline Time MicroSeconds (int64x64_t us)
889 {
890  return Time::From (us, Time::US);
891 }
896 inline Time NanoSeconds (int64x64_t ns)
897 {
898  return Time::From (ns, Time::NS);
899 }
904 inline Time PicoSeconds (int64x64_t ps)
905 {
906  return Time::From (ps, Time::PS);
907 }
912 inline Time FemtoSeconds (int64x64_t fs)
913 {
914  return Time::From (fs, Time::FS);
915 }
920 inline Time Minutes (int64x64_t minutes)
921 {
922  return Time::From (minutes, Time::MIN);
923 }
928 inline Time Hours (int64x64_t hours)
929 {
930  return Time::From (hours, Time::H);
931 }
936 inline Time Days (int64x64_t days)
937 {
938  return Time::From (days, Time::D);
939 }
944 inline Time Years (int64x64_t years)
945 {
946  return Time::From (years, Time::Y);
947 }
948 
949 // internal function not publicly documented
950 inline Time TimeStep (uint64_t ts)
951 {
952  return Time (ts);
953 }
954 
963 
971 
977 inline
979 {
980  return MakeTimeChecker (Time::Min (), Time::Max ());
981 }
982 
988 inline
990 {
991  return MakeTimeChecker (min, Time::Max ());
992 }
993 
994 
995 } // namespace ns3
996 
997 #endif /* TIME_H */
static struct Resolution * PeekResolution(void)
Definition: nstime.h:516
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Definition: nstime.h:727
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:49
nanosecond
Definition: nstime.h:96
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
#define ATTRIBUTE_VALUE_DEFINE(type)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
bool IsPositive(void) const
Definition: nstime.h:244
microsecond
Definition: nstime.h:95
int64x64_t Abs(const int64x64_t &value)
Definition: int64x64.h:85
Time(const int64x64_t &value)
Definition: nstime.h:482
Time MilliSeconds(uint64_t ms)
create ns3::Time instances in units of milliseconds.
Definition: nstime.h:743
Time Minutes(double minutes)
create ns3::Time instances in units of minutes (equal to 60 seconds).
Definition: nstime.h:818
double ToDouble(enum Unit timeUnit) const
Definition: nstime.h:444
Control the scheduling of simulation events.
Definition: simulator.h:62
Time MilliSeconds(int64x64_t ms)
Definition: nstime.h:880
int64x64_t timeFrom
Multiplier to convert from this unit.
Definition: nstime.h:505
static Time Min()
Minimum representable Time.
Definition: nstime.h:204
Time TimeStep(uint64_t ts)
Definition: nstime.h:950
Time Minutes(int64x64_t minutes)
Definition: nstime.h:920
Time PicoSeconds(uint64_t ps)
create ns3::Time instances in units of picoseconds.
Definition: nstime.h:788
Time FemtoSeconds(int64x64_t fs)
Definition: nstime.h:912
day, 24 hours
Definition: nstime.h:90
bool IsZero(void) const
Definition: nstime.h:230
friend bool operator<(const Time &lhs, const Time &rhs)
Definition: nstime.h:640
friend bool operator!=(const Time &lhs, const Time &rhs)
Definition: nstime.h:625
int64_t ToInteger(enum Unit timeUnit) const
Definition: nstime.h:412
Time Days(int64x64_t days)
Definition: nstime.h:936
minute, 60 seconds
Definition: nstime.h:92
bool operator>(const Time &lhs, const Time &rhs)
Definition: nstime.h:645
static Time From(const int64x64_t &value)
Definition: nstime.h:490
Time Years(double years)
create ns3::Time instances in units of years (equal to 365 days).
Definition: nstime.h:863
bool operator<(const Room &a, const Room &b)
hour, 60 minutes
Definition: nstime.h:91
int64_t GetFemtoSeconds(void) const
Definition: nstime.h:315
Time NanoSeconds(int64x64_t ns)
Definition: nstime.h:896
Time(unsigned long int v)
Definition: nstime.h:163
Time FemtoSeconds(uint64_t fs)
create ns3::Time instances in units of femtoseconds.
Definition: nstime.h:803
int Compare(const Time &o) const
Definition: nstime.h:265
Time Seconds(int64x64_t seconds)
Definition: nstime.h:872
Time MicroSeconds(int64x64_t us)
Definition: nstime.h:888
friend Time operator-(const Time &lhs, const Time &rhs)
Definition: nstime.h:653
static Time FromDouble(double value, enum Unit timeUnit)
Definition: nstime.h:433
struct Information info[LAST]
Conversion info from current unit.
Definition: nstime.h:512
static bool NS_UNUSED_GLOBAL(g_TimeStaticInit)
friend Time operator+(const Time &lhs, const Time &rhs)
Definition: nstime.h:649
static Time Max()
Maximum representable Time.
Definition: nstime.h:211
friend Time Abs(const Time &time)
double GetSeconds(void) const
Definition: nstime.h:274
Time & operator+=(Time &lhs, const Time &rhs)
Definition: nstime.h:657
Time(int v)
Definition: nstime.h:131
picosecond
Definition: nstime.h:97
year, 365 days
Definition: nstime.h:89
static enum Unit GetResolution(void)
Definition: time.cc:375
int64_t GetMicroSeconds(void) const
Definition: nstime.h:291
friend Time & operator-=(Time &lhs, const Time &rhs)
Definition: nstime.h:662
Time(long long int v)
Definition: nstime.h:147
Current time unit, and conversion info.
Definition: nstime.h:510
static bool StaticInit()
Function to force static initialization of Time.
Definition: time.cc:58
Time MicroSeconds(uint64_t us)
create ns3::Time instances in units of microseconds.
Definition: nstime.h:758
bool IsStrictlyPositive(void) const
Definition: nstime.h:258
bool fromMul
Multiple when converting From, otherwise divide.
Definition: nstime.h:502
Time NanoSeconds(uint64_t ns)
create ns3::Time instances in units of nanoseconds.
Definition: nstime.h:773
Ptr< SampleEmitter > s
Unit
The unit to use to interpret a number representing time.
Definition: nstime.h:87
static void ConvertTimes(const enum Unit unit)
Convert existing Times to the new unit.
Definition: time.cc:338
Time PicoSeconds(int64x64_t ps)
Definition: nstime.h:904
friend bool operator>=(const Time &lhs, const Time &rhs)
Definition: nstime.h:635
Time operator+(const Time &lhs, const Time &rhs)
Definition: nstime.h:649
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Definition: int64x64.h:90
ATTRIBUTE_ACCESSOR_DEFINE(Boolean)
Time(long int v)
Definition: nstime.h:139
static struct Resolution SetDefaultNsResolution(void)
Definition: time.cc:165
int64_t factor
Ratio of this unit / current unit.
Definition: nstime.h:503
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Definition: int64x64.h:95
bool operator<=(const Time &lhs, const Time &rhs)
Definition: nstime.h:630
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:43
Time & operator-=(Time &lhs, const Time &rhs)
Definition: nstime.h:662
Time(double v)
Definition: nstime.h:123
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Definition: callback.h:1213
Time(unsigned long long int v)
Definition: nstime.h:171
bool operator>=(const Time &lhs, const Time &rhs)
Definition: nstime.h:635
Time Years(int64x64_t years)
Definition: nstime.h:944
friend Time & operator+=(Time &lhs, const Time &rhs)
Definition: nstime.h:657
friend bool operator==(const Time &lhs, const Time &rhs)
Definition: nstime.h:620
bool IsNegative(void) const
Definition: nstime.h:237
int64_t GetTimeStep(void) const
Definition: nstime.h:356
double GetHours(void) const
Definition: nstime.h:332
Time Days(double days)
create ns3::Time instances in units of days (equal to 24 hours).
Definition: nstime.h:848
Time()
Definition: nstime.h:107
int64_t GetInteger(void) const
Definition: nstime.h:364
Time operator-(const Time &lhs, const Time &rhs)
Definition: nstime.h:653
~Time()
Destructor.
Definition: nstime.h:219
double GetDouble(void) const
Definition: nstime.h:360
static struct Information * PeekInformation(enum Unit timeUnit)
Definition: nstime.h:521
int64_t GetNanoSeconds(void) const
Definition: nstime.h:299
Time(unsigned int v)
Definition: nstime.h:155
static void Mark(Time *const time)
Record a Time instance with the MarkedTimes.
Definition: time.cc:282
friend bool operator>(const Time &lhs, const Time &rhs)
Definition: nstime.h:645
static Time FromInteger(uint64_t value, enum Unit timeUnit)
Definition: nstime.h:392
Time Hours(double hours)
create ns3::Time instances in units of hours (equal to 60 minutes).
Definition: nstime.h:833
int64_t GetPicoSeconds(void) const
Definition: nstime.h:307
How to convert between other units and the current unit.
Definition: nstime.h:499
double GetDays(void) const
Definition: nstime.h:340
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.cc:89
enum Time::Unit unit
Current time unit.
Definition: nstime.h:513
bool IsStrictlyNegative(void) const
Definition: nstime.h:251
static void SetResolution(enum Unit resolution)
Definition: time.cc:175
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:452
static void Clear(Time *const time)
Remove a Time instance from the MarkedTimes, called by ~Time()
Definition: time.cc:308
second
Definition: nstime.h:93
std::set< Time * > MarkedTimes
Record all instances of Time, so we can rescale them when the resolution changes. ...
Definition: nstime.h:549
static MarkedTimes * g_markingTimes
Record of outstanding Time objects which will need conversion when the resolution is set...
Definition: nstime.h:564
double GetYears(void) const
Definition: nstime.h:348
Time Hours(int64x64_t hours)
Definition: nstime.h:928
static void ClearMarkedTimes()
Remove all MarkedTimes.
Definition: time.cc:251
femtosecond
Definition: nstime.h:98
millisecond
Definition: nstime.h:94
friend bool operator<=(const Time &lhs, const Time &rhs)
Definition: nstime.h:630
int64_t GetMilliSeconds(void) const
Definition: nstime.h:283
double GetMinutes(void) const
Definition: nstime.h:324
Time & operator=(const Time &o)
Definition: nstime.h:102
static Time From(const int64x64_t &from, enum Unit timeUnit)
Definition: nstime.h:448
int64x64_t timeTo
Multiplier to convert to this unit.
Definition: nstime.h:504
Time(const Time &o)
Definition: nstime.h:115
int64_t m_data
Virtual time value, in the current unit.
Definition: nstime.h:611
bool toMul
Multiply when converting To, otherwise divide.
Definition: nstime.h:501
int64x64_t To(enum Unit timeUnit) const
Definition: nstime.h:464