Home | History | Annotate | Download | only in base

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 always incrementing for use
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
16 // decrease (if the user changes the computer clock, Time::Now() may actually
26 #include <time.h>
33 #include <sys/time.h>
44 class Time;
47 // This unit test does a lot of manual time manipulation.
57 // Converts units of time to TimeDeltas.
76 // Returns the time delta in some unit. The F versions return a floating
137 Time operator+(Time t) const;
161 friend class Time;
179 // Time -----------------------------------------------------------------------
181 // Represents a wall clock time.
182 class BASE_API Time {
205 // Represents an exploded time that can be formatted nicely. This is kind of
221 // Exploded value can be successfully converted to a Time value.
225 // Contains the NULL time. Use Time::Now() to get the current time.
226 explicit Time() : us_(0) {
229 // Returns true if the time object has not been initialized.
234 // Returns the time for epoch in Unix-like system (Jan 1, 1970).
235 static Time UnixEpoch();
237 // Returns the current time. Watch out, the system might adjust its clock
238 // in which case time will actually go backwards. We don't guarantee that
240 static Time Now();
242 // Returns the current time. Same as Now() except that this function always
243 // uses system time so that there are no discrepancies between the returned
244 // time and system time even on virtual environments including our test bot.
246 static Time NowFromSystemTime();
248 // Converts to/from time_t in UTC and a Time class.
249 // TODO(brettw) this should be removed once everybody starts using the |Time|
251 static Time FromTimeT(time_t tt);
254 // Converts time to/from a double which is the number of seconds since epoch
255 // (Jan 1, 1970). Webkit uses this format to represent time.
256 // Because WebKit initializes double time value to 0 to indicate "not
257 // initialized", we map it to empty Time object that also means "not
259 static Time FromDoubleT(double dt);
267 static Time FromFileTime(FILETIME ft);
270 // The minimum time of a low resolution timer. This is basically a windows
293 // Converts an exploded structure representing either the local time or UTC
294 // into a Time class.
295 static Time FromUTCExploded(const Exploded& exploded) {
298 static Time FromLocalExploded(const Exploded& exploded) {
302 // Converts an integer value representing Time to a class. This is used
303 // when deserializing a |Time| structure, using a value known to be
306 static Time FromInternalValue(int64 us) {
307 return Time(us);
310 // Converts a string representation of time to a Time object.
311 // An example of a time string which is converted is as below:-
313 // in the input string, we assume local time.
315 // a new time converter class.
316 static bool FromString(const wchar_t* time_string, Time* parsed_time);
325 // Fills the given exploded structure with either the local time or UTC from
326 // this time structure (containing UTC).
334 // Rounds this time down to the nearest day in local time. It will represent
336 Time LocalMidnight() const;
338 Time& operator=(Time other) {
344 TimeDelta operator-(Time other) const {
348 // Modify by some time delta.
349 Time& operator+=(TimeDelta delta) {
353 Time& operator-=(TimeDelta delta) {
358 // Return a new time modified by some delta.
359 Time operator+(TimeDelta delta) const {
360 return Time(us_ + delta.delta_);
362 Time operator-(TimeDelta delta) const {
363 return Time(us_ - delta.delta_);
367 bool operator==(Time other) const {
370 bool operator!=(Time other) const {
373 bool operator<(Time other) const {
376 bool operator<=(Time other) const {
379 bool operator>(Time other) const {
382 bool operator>=(Time other) const {
389 explicit Time(int64 us) : us_(us) {
392 // Explodes the given time to either local time |is_local = true| or UTC
396 // Unexplodes a given time assuming the source is either local time
398 static Time FromExploded(bool is_local, const Exploded& exploded);
411 // Time in microseconds in UTC.
419 return TimeDelta(days * Time::kMicrosecondsPerDay);
424 return TimeDelta(hours * Time::kMicrosecondsPerHour);
429 return TimeDelta(minutes * Time::kMicrosecondsPerMinute);
434 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
439 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
447 inline Time TimeDelta::operator+(Time t) const {
448 return Time(t.us_ + delta_);
470 // Get the absolute value of QPC time drift. For testing.
498 // Modify by some time delta.