| 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 a platform-dependent epoch. Each | 6 // microseconds (s/1,000,000) since a platform-dependent epoch. Each |
| 7 // platform's epoch, along with other system-dependent clock interface | 7 // platform's epoch, along with other system-dependent clock interface |
| 8 // routines, is defined in time_PLATFORM.cc. | 8 // routines, is 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 always incrementing for use | 13 // TimeTicks represents an abstract time that is always incrementing for use |
| 14 // in measuring time durations. It is internally represented in microseconds. | 14 // in measuring time durations. It is internally represented in microseconds. |
| 15 // It can not be converted to a human-readable time, but is guaranteed not to | 15 // It can not be converted to a human-readable time, but is guaranteed not to |
| 16 // decrease (if the user changes the computer clock, Time::Now() may actually | 16 // decrease (if the user changes the computer clock, Time::Now() may actually |
| 17 // decrease or jump). | 17 // decrease or jump). |
| 18 // | 18 // |
| 19 // These classes are represented as only a 64-bit value, so they can be | 19 // These classes are represented as only a 64-bit value, so they can be |
| 20 // efficiently passed by value. | 20 // efficiently passed by value. |
| 21 | 21 |
| 22 #ifndef BASE_TIME_H_ | 22 #ifndef BASE_TIME_H_ |
| 23 #define BASE_TIME_H_ | 23 #define BASE_TIME_H_ |
| 24 #pragma once | |
| 25 | 24 |
| 26 #include <time.h> | 25 #include <time.h> |
| 27 | 26 |
| 28 #include "base/atomicops.h" | 27 #include "base/atomicops.h" |
| 29 #include "base/base_export.h" | 28 #include "base/base_export.h" |
| 30 #include "base/basictypes.h" | 29 #include "base/basictypes.h" |
| 31 | 30 |
| 32 #if defined(OS_POSIX) | 31 #if defined(OS_POSIX) |
| 33 // For struct timeval. | 32 // For struct timeval. |
| 34 #include <sys/time.h> | 33 #include <sys/time.h> |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 #endif | 588 #endif |
| 590 }; | 589 }; |
| 591 | 590 |
| 592 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 591 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
| 593 return TimeTicks(t.ticks_ + delta_); | 592 return TimeTicks(t.ticks_ + delta_); |
| 594 } | 593 } |
| 595 | 594 |
| 596 } // namespace base | 595 } // namespace base |
| 597 | 596 |
| 598 #endif // BASE_TIME_H_ | 597 #endif // BASE_TIME_H_ |
| OLD | NEW |