| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Time represents an absolute point in time, internally represented as | 5 // Time represents an absolute point in time, internally represented as |
| 6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) | 6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) |
| 7 // (See http://crbug.com/14734). System-dependent clock interface routines are | 7 // (See http://crbug.com/14734). System-dependent clock interface routines are |
| 8 // defined in time_PLATFORM.cc. | 8 // defined in time_PLATFORM.cc. |
| 9 // | 9 // |
| 10 // TimeDelta represents a duration of time, internally represented in | 10 // TimeDelta represents a duration of time, internally represented in |
| 11 // microseconds. | 11 // microseconds. |
| 12 // | 12 // |
| 13 // TimeTicks represents an abstract time that is most of the time incrementing | 13 // TimeTicks represents an abstract time that is most of the time incrementing |
| 14 // for use in measuring time durations. It is internally represented in | 14 // for use in measuring time durations. It is internally represented in |
| 15 // microseconds. It can not be converted to a human-readable time, but is | 15 // microseconds. It can not be converted to a human-readable time, but is |
| 16 // guaranteed not to decrease (if the user changes the computer clock, | 16 // guaranteed not to decrease (if the user changes the computer clock, |
| 17 // Time::Now() may actually decrease or jump). But note that TimeTicks may | 17 // Time::Now() may actually decrease or jump). But note that TimeTicks may |
| 18 // "stand still", for example if the computer suspended. | 18 // "stand still", for example if the computer suspended. |
| 19 // | 19 // |
| 20 // These classes are represented as only a 64-bit value, so they can be | 20 // These classes are represented as only a 64-bit value, so they can be |
| 21 // efficiently passed by value. | 21 // efficiently passed by value. |
| 22 | 22 |
| 23 #ifndef BASE_TIME_H_ | 23 #ifndef BASE_TIME_TIME_H_ |
| 24 #define BASE_TIME_H_ | 24 #define BASE_TIME_TIME_H_ |
| 25 | 25 |
| 26 #include <time.h> | 26 #include <time.h> |
| 27 | 27 |
| 28 #include "base/atomicops.h" | 28 #include "base/atomicops.h" |
| 29 #include "base/base_export.h" | 29 #include "base/base_export.h" |
| 30 #include "base/basictypes.h" | 30 #include "base/basictypes.h" |
| 31 | 31 |
| 32 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
| 33 #include <CoreFoundation/CoreFoundation.h> | 33 #include <CoreFoundation/CoreFoundation.h> |
| 34 // Avoid Mac system header macro leak. | 34 // Avoid Mac system header macro leak. |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 static TickFunctionType SetMockTickFunction(TickFunctionType ticker); | 641 static TickFunctionType SetMockTickFunction(TickFunctionType ticker); |
| 642 #endif | 642 #endif |
| 643 }; | 643 }; |
| 644 | 644 |
| 645 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 645 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
| 646 return TimeTicks(t.ticks_ + delta_); | 646 return TimeTicks(t.ticks_ + delta_); |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace base | 649 } // namespace base |
| 650 | 650 |
| 651 #endif // BASE_TIME_H_ | 651 #endif // BASE_TIME_TIME_H_ |
| OLD | NEW |