Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: base/time.h

Issue 496007: Make ProcessWatcher use kqueues on Mac. (Closed)
Patch Set: No need for a thread Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/file_util.h ('k') | base/time_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static TimeDelta FromMilliseconds(int64 ms); 55 static TimeDelta FromMilliseconds(int64 ms);
56 static TimeDelta FromMicroseconds(int64 us); 56 static TimeDelta FromMicroseconds(int64 us);
57 57
58 // Returns the internal numeric value of the TimeDelta object. Please don't 58 // Returns the internal numeric value of the TimeDelta object. Please don't
59 // use this and do arithmetic on it, as it is more error prone than using the 59 // use this and do arithmetic on it, as it is more error prone than using the
60 // provided operators. 60 // provided operators.
61 int64 ToInternalValue() const { 61 int64 ToInternalValue() const {
62 return delta_; 62 return delta_;
63 } 63 }
64 64
65 #if defined(OS_POSIX)
66 struct timespec ToTimeSpec() const;
67 #endif
68
65 // Returns the time delta in some unit. The F versions return a floating 69 // Returns the time delta in some unit. The F versions return a floating
66 // point value, the "regular" versions return a rounded-down value. 70 // point value, the "regular" versions return a rounded-down value.
67 // 71 //
68 // InMillisecondsRoundedUp() instead returns an integer that is rounded up 72 // InMillisecondsRoundedUp() instead returns an integer that is rounded up
69 // to the next full millisecond. 73 // to the next full millisecond.
70 int InDays() const; 74 int InDays() const;
71 int InHours() const; 75 int InHours() const;
72 int InMinutes() const; 76 int InMinutes() const;
73 double InSecondsF() const; 77 double InSecondsF() const;
74 int64 InSeconds() const; 78 int64 InSeconds() const;
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 #endif 496 #endif
493 }; 497 };
494 498
495 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { 499 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {
496 return TimeTicks(t.ticks_ + delta_); 500 return TimeTicks(t.ticks_ + delta_);
497 } 501 }
498 502
499 } // namespace base 503 } // namespace base
500 504
501 #endif // BASE_TIME_H_ 505 #endif // BASE_TIME_H_
OLDNEW
« no previous file with comments | « base/file_util.h ('k') | base/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698