| 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 coordinated universal time (UTC), | 5 // Time represents an absolute point in coordinated universal time (UTC), |
| 6 // internally represented as microseconds (s/1,000,000) since the Windows epoch | 6 // internally represented as microseconds (s/1,000,000) since the Windows epoch |
| 7 // (1601-01-01 00:00:00 UTC) (See http://crbug.com/14734). System-dependent | 7 // (1601-01-01 00:00:00 UTC) (See http://crbug.com/14734). System-dependent |
| 8 // clock interface routines are defined in time_PLATFORM.cc. | 8 // clock interface routines are 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 |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 } | 569 } |
| 570 | 570 |
| 571 inline Time TimeDelta::operator+(Time t) const { | 571 inline Time TimeDelta::operator+(Time t) const { |
| 572 return Time(t.us_ + delta_); | 572 return Time(t.us_ + delta_); |
| 573 } | 573 } |
| 574 | 574 |
| 575 // TimeTicks ------------------------------------------------------------------ | 575 // TimeTicks ------------------------------------------------------------------ |
| 576 | 576 |
| 577 class BASE_EXPORT TimeTicks { | 577 class BASE_EXPORT TimeTicks { |
| 578 public: | 578 public: |
| 579 // We define this even without OS_CHROMEOS for seccomp sandbox testing. | |
| 580 #if defined(OS_LINUX) | |
| 581 // Force definition of the system trace clock; it is a chromeos-only api | |
| 582 // at the moment and surfacing it in the right place requires mucking | |
| 583 // with glibc et al. | |
| 584 static const clockid_t kClockSystemTrace = 11; | |
| 585 #endif | |
| 586 | |
| 587 TimeTicks() : ticks_(0) { | 579 TimeTicks() : ticks_(0) { |
| 588 } | 580 } |
| 589 | 581 |
| 590 // Platform-dependent tick count representing "right now." | 582 // Platform-dependent tick count representing "right now." |
| 591 // The resolution of this clock is ~1-15ms. Resolution varies depending | 583 // The resolution of this clock is ~1-15ms. Resolution varies depending |
| 592 // on hardware/operating system configuration. | 584 // on hardware/operating system configuration. |
| 593 static TimeTicks Now(); | 585 static TimeTicks Now(); |
| 594 | 586 |
| 595 // Returns a platform-dependent high-resolution tick count. Implementation | 587 // Returns a platform-dependent high-resolution tick count. Implementation |
| 596 // is hardware dependent and may or may not return sub-millisecond | 588 // is hardware dependent and may or may not return sub-millisecond |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 #endif | 730 #endif |
| 739 }; | 731 }; |
| 740 | 732 |
| 741 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 733 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
| 742 return TimeTicks(t.ticks_ + delta_); | 734 return TimeTicks(t.ticks_ + delta_); |
| 743 } | 735 } |
| 744 | 736 |
| 745 } // namespace base | 737 } // namespace base |
| 746 | 738 |
| 747 #endif // BASE_TIME_TIME_H_ | 739 #endif // BASE_TIME_TIME_H_ |
| OLD | NEW |