Home | History | Annotate | Download | only in time

Lines Matching full:time

5 // Time represents an absolute point in time, internally represented as
10 // TimeDelta represents a duration of time, internally represented in
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
15 // microseconds. It can not be converted to a human-readable time, but is
17 // Time::Now() may actually decrease or jump). But note that TimeTicks may
26 #include <time.h>
40 #include <sys/time.h>
53 class Time;
63 // Converts units of time to TimeDeltas.
94 // Returns the time delta in some unit. The F versions return a floating
155 Time operator+(Time t) const;
179 friend class Time;
197 // Time -----------------------------------------------------------------------
199 // Represents a wall clock time.
200 class BASE_EXPORT Time {
223 // Represents an exploded time that can be formatted nicely. This is kind of
239 // Exploded value can be successfully converted to a Time value.
243 // Contains the NULL time. Use Time::Now() to get the current time.
244 Time() : us_(0) {
247 // Returns true if the time object has not been initialized.
252 // Returns true if the time object is the maximum time.
257 // Returns the time for epoch in Unix-like system (Jan 1, 1970).
258 static Time UnixEpoch();
260 // Returns the current time. Watch out, the system might adjust its clock
261 // in which case time will actually go backwards. We don't guarantee that
263 static Time Now();
265 // Returns the maximum time, which should be greater than any reasonable time
267 static Time Max();
269 // Returns the current time. Same as Now() except that this function always
270 // uses system time so that there are no discrepancies between the returned
271 // time and system time even on virtual environments including our test bot.
273 static Time NowFromSystemTime();
275 // Converts to/from time_t in UTC and a Time class.
276 // TODO(brettw) this should be removed once everybody starts using the |Time|
278 static Time FromTimeT(time_t tt);
281 // Converts time to/from a double which is the number of seconds since epoch
282 // (Jan 1, 1970). Webkit uses this format to represent time.
283 // Because WebKit initializes double time value to 0 to indicate "not
284 // initialized", we map it to empty Time object that also means "not
286 static Time FromDoubleT(double dt);
290 // Converts the timespec structure to time. MacOS X 10.8.3 (and tentatively,
294 static Time FromTimeSpec(const timespec& ts);
300 static Time FromJsTime(double ms_since_epoch);
304 static Time FromTimeVal(struct timeval t);
309 static Time FromCFAbsoluteTime(CFAbsoluteTime t);
314 static Time FromFileTime(FILETIME ft);
317 // The minimum time of a low resolution timer. This is basically a windows
346 // Converts an exploded structure representing either the local time or UTC
347 // into a Time class.
348 static Time FromUTCExploded(const Exploded& exploded) {
351 static Time FromLocalExploded(const Exploded& exploded) {
355 // Converts an integer value representing Time to a class. This is used
356 // when deserializing a |Time| structure, using a value known to be
359 static Time FromInternalValue(int64 us) {
360 return Time(us);
363 // Converts a string representation of time to a Time object.
364 // An example of a time string which is converted is as below:-
366 // in the input string, FromString assumes local time and FromUTCString
370 // a new time converter class.
371 static bool FromString(const char* time_string, Time* parsed_time) {
374 static bool FromUTCString(const char* time_string, Time* parsed_time) {
385 // Fills the given exploded structure with either the local time or UTC from
386 // this time structure (containing UTC).
394 // Rounds this time down to the nearest day in local time. It will represent
396 Time LocalMidnight() const;
398 Time& operator=(Time other) {
404 TimeDelta operator-(Time other) const {
408 // Modify by some time delta.
409 Time& operator+=(TimeDelta delta) {
413 Time& operator-=(TimeDelta delta) {
418 // Return a new time modified by some delta.
419 Time operator+(TimeDelta delta) const {
420 return Time(us_ + delta.delta_);
422 Time operator-(TimeDelta delta) const {
423 return Time(us_ - delta.delta_);
427 bool operator==(Time other) const {
430 bool operator!=(Time other) const {
433 bool operator<(Time other) const {
436 bool operator<=(Time other) const {
439 bool operator>(Time other) const {
442 bool operator>=(Time other) const {
449 explicit Time(int64 us) : us_(us) {
452 // Explodes the given time to either local time |is_local = true| or UTC
456 // Unexplodes a given time assuming the source is either local time
458 static Time FromExploded(bool is_local, const Exploded& exploded);
460 // Converts a string representation of time to a Time object.
461 // An example of a time string which is converted is as below:-
463 // in the input string, local time |is_local = true| or
469 Time* parsed_time);
485 // Time in microseconds in UTC.
493 return TimeDelta(days * Time::kMicrosecondsPerDay);
498 return TimeDelta(hours * Time::kMicrosecondsPerHour);
503 return TimeDelta(minutes * Time::kMicrosecondsPerMinute);
508 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
513 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
521 inline Time TimeDelta::operator+(Time t) const {
522 return Time(t.us_ + delta_);
552 // Returns thread-specific CPU-time on systems that support this feature.
554 // to (approximately) measure how much time the calling thread spent doing
559 // Returns the current system trace time or, if none is defined, the current
560 // high-res time (i.e. HighResNow()). On systems where a global trace clock
567 // Get the absolute value of QPC time drift. For testing.
606 // Modify by some time delta.