time2_demo_output.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // time2_demo.output ----------------------------------------------------------//
  2. // Copyright 2008 Howard Hinnant
  3. // Copyright 2008 Beman Dawes
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // See http://www.boost.org/LICENSE_1_0.txt
  6. Running basic examples
  7. sleep_for 3000000 microseconds
  8. sleep_for 1 microseconds
  9. sleep_until 10:47:17.728293 which is 4499340 microseconds away
  10. try_lock_for 30000 microseconds
  11. try_lock_until 10:47:17.728285 which is 4499303 microseconds away
  12. wait_for 60000000 microseconds
  13. wait_until 10:47:17.728285 which is 4499264 microseconds away
  14. sleep_for 250000 microseconds
  15. sleep_until 10:47:14.729077 which is 1499979 microseconds away
  16. ***************
  17. * testStdUser *
  18. ***************
  19. 100 hours expressed as hours = 100
  20. 100 hours expressed as nanoseconds = 360000000000000
  21. 200 hours expressed as nanoseconds = 720000000000000
  22. 300 hours expressed as nanoseconds = 1080000000000000
  23. hr = ns; // does not compile
  24. hr * ns; // does not compile
  25. duration<double> has count() = 2.5
  26. seconds sec = duration<double> won't compile
  27. seconds has count() = 2
  28. *************
  29. * testUser1 *
  30. *************
  31. Speed = 24.5872 meters/sec
  32. Acceleration = 9.81456 meters/sec^2
  33. Distance = 13.5204 meters
  34. There are 125/201168 miles/meter which is approximately 0.000621371
  35. There are 201168/125 meters/mile which is approximately 1609.34
  36. 1 attosecond is 1e-18 seconds
  37. sec = as; // compiles
  38. 1 second is 1e+18 attoseconds
  39. as = sec; // compiles
  40. *************
  41. * testUser2 *
  42. *************
  43. 100 years expressed as years = 100
  44. 100 years expressed as nanoseconds = 3155695200000000000
  45. 200 years expressed as nanoseconds = 6311390400000000000
  46. 300 years expressed as nanoseconds = inf
  47. yr = ns; // does not compile
  48. ps = yr; // does not compile
  49. 100 years expressed as picoseconds = inf
  50. 0.1 years expressed as picoseconds = 3155695200000000000
  51. 200 million years ago encoded in years: -200000000
  52. 200 million years ago encoded in days: -73048500000
  53. 200 million years ago encoded in millennium: -200000
  54. Demonstrate "uninitialized protection" behavior:
  55. nan
  56. d = 3e-09
  57. d = 10800
  58. d = 0.666667
  59. d = 10799.999999997
  60. 292 years of hours = 2559672hr
  61. Add a nanosecond = 9214819200000000001ns
  62. Find the difference = 1ns
  63. 244,000 years of hours = 2138904000hr
  64. Add a microsecond = 7700054400000000001us
  65. Find the difference = 1us
  66. ********* nanoseconds *********
  67. The period of nanoseconds is 1e-09 seconds.
  68. The frequency of nanoseconds is 1e+09 Hz.
  69. The representation is integral
  70. The precision is 1e-09 seconds.
  71. The range is +/- 292.277 years.
  72. sizeof(nanoseconds) = 8
  73. ********* microseconds *********
  74. The period of microseconds is 1e-06 seconds.
  75. The frequency of microseconds is 1e+06 Hz.
  76. The representation is integral
  77. The precision is 1e-06 seconds.
  78. The range is +/- 292277 years.
  79. sizeof(microseconds) = 8
  80. ********* milliseconds *********
  81. The period of milliseconds is 0.001 seconds.
  82. The frequency of milliseconds is 1000 Hz.
  83. The representation is integral
  84. The precision is 0.001 seconds.
  85. The range is +/- 2.92277e+08 years.
  86. sizeof(milliseconds) = 8
  87. ********* seconds *********
  88. The period of seconds is 1 seconds.
  89. The frequency of seconds is 1 Hz.
  90. The representation is integral
  91. The precision is 1 seconds.
  92. The range is +/- 2.92277e+11 years.
  93. sizeof(seconds) = 8
  94. ********* minutes *********
  95. The period of minutes is 60 seconds.
  96. The frequency of minutes is 0.0166667 Hz.
  97. The representation is integral
  98. The precision is 60 seconds.
  99. The range is +/- 4083.06 years.
  100. sizeof(minutes) = 4
  101. ********* hours *********
  102. The period of hours is 3600 seconds.
  103. The frequency of hours is 0.000277778 Hz.
  104. The representation is integral
  105. The precision is 3600 seconds.
  106. The range is +/- 244984 years.
  107. sizeof(hours) = 4
  108. ********* duration<double> *********
  109. The period of duration<double> is 1 seconds.
  110. The frequency of duration<double> is 1 Hz.
  111. The representation is floating point
  112. The precision is the most significant 15 decimal digits.
  113. The range is +/- 5.69666e+300 years.
  114. sizeof(duration<double>) = 8
  115. success
  116. test_with_xtime
  117. {3,251000}
  118. 3251 milliseconds
  119. {3,251000}
  120. {3,0}
  121. {3,1}
  122. system_clock test
  123. paused 5001000 nanoseconds
  124. system_clock resolution estimate: 0 nanoseconds
  125. monotonic_clock test
  126. paused 5000181 nanoseconds
  127. monotonic_clock resolution estimate: 97 nanoseconds
  128. high_resolution_clock test
  129. paused 5000277 nanoseconds
  130. high_resolution_clock resolution estimate: 96 nanoseconds
  131. mixed clock test
  132. Add 5 milliseconds to a high_resolution_clock::time_point
  133. Subtracting system_clock::time_point from monotonic_clock::time_point doesn't compile
  134. subtract high_resolution_clock::time_point from monotonic_clock::time_point and add that to a system_clock::time_point
  135. subtract two system_clock::time_point's and output that in microseconds:
  136. 5000 microseconds
  137. timeval_demo system clock test
  138. sizeof xtime_clock::time_point = 8
  139. sizeof xtime_clock::duration = 8
  140. sizeof xtime_clock::rep = 8
  141. paused 5001000 nanoseconds
  142. runtime_resolution test
  143. paused 5000205 nanoseconds
  144. C map test
  145. It is now 10:47:13 2008-4-22
  146. Round-tripping through the C interface truncated the precision by 255445 microseconds
  147. 2160000
  148. 0
  149. 3600000
  150. 0
  151. 2999998997 * 1/1000000000 seconds
  152. 0 * 1/1000000000 seconds
  153. 15778476000000000 microseconds
  154. paused 5001000 nanoseconds
  155. ********* milliseconds(3) * 2.5 *********
  156. The period of milliseconds(3) * 2.5 is 0.001 seconds.
  157. The frequency of milliseconds(3) * 2.5 is 1000 Hz.
  158. The representation is floating point
  159. The precision is the most significant 15 decimal digits.
  160. The range is +/- 5.69666e+297 years.
  161. sizeof(milliseconds(3) * 2.5) = 8
  162. 7.5
  163. milliseconds ms(3.5) doesn't compile
  164. Simulated 400MHz clock which has a tick period of 2.5 nanoseconds
  165. delay = 500 nanoseconds which is 200 cycles
  166. paused 201 cycles which is 502 nanoseconds
  167. Simulated 400MHz clock modeled with nanoseconds
  168. delay = 500 nanoseconds
  169. paused 503 nanoseconds
  170. Simulated 1500MHz clock which has a tick period of 0.666667 nanoseconds
  171. delay = 500 nanoseconds which is 750 cycles
  172. paused 751 cycles which is 500 nanoseconds
  173. Simulated 1500MHz clock modeled with nanoseconds
  174. delay = 500 nanoseconds
  175. paused 500 nanoseconds
  176. duration<unsigned>::min().count() = 0
  177. duration<unsigned>::zero().count() = 0
  178. duration<unsigned>::max().count() = 4294967295
  179. duration<int>::min().count() = -2147483647
  180. duration<int>::zero().count() = 0
  181. duration<int>::max().count() = 2147483647