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

Side by Side Diff: src/platform/time.h

Issue 25468003: Always use timeGetTime() for TimeTicks::Now() on Windows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « src/platform/elapsed-timer.h ('k') | src/platform/time.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // The resolution of this clock is ~1-15ms. Resolution varies depending 326 // The resolution of this clock is ~1-15ms. Resolution varies depending
327 // on hardware/operating system configuration. 327 // on hardware/operating system configuration.
328 // This method never returns a null TimeTicks. 328 // This method never returns a null TimeTicks.
329 static TimeTicks Now(); 329 static TimeTicks Now();
330 330
331 // Returns a platform-dependent high-resolution tick count. Implementation 331 // Returns a platform-dependent high-resolution tick count. Implementation
332 // is hardware dependent and may or may not return sub-millisecond 332 // is hardware dependent and may or may not return sub-millisecond
333 // resolution. THIS CALL IS GENERALLY MUCH MORE EXPENSIVE THAN Now() AND 333 // resolution. THIS CALL IS GENERALLY MUCH MORE EXPENSIVE THAN Now() AND
334 // SHOULD ONLY BE USED WHEN IT IS REALLY NEEDED. 334 // SHOULD ONLY BE USED WHEN IT IS REALLY NEEDED.
335 // This method never returns a null TimeTicks. 335 // This method never returns a null TimeTicks.
336 static TimeTicks HighResNow(); 336 static TimeTicks HighResolutionNow();
337
338 // Returns true if the high-resolution clock is working on this system.
339 static bool IsHighResolutionClockWorking();
337 340
338 // Returns true if this object has not been initialized. 341 // Returns true if this object has not been initialized.
339 bool IsNull() const { return ticks_ == 0; } 342 bool IsNull() const { return ticks_ == 0; }
340 343
341 // Converts to/from internal values. The meaning of the "internal value" is 344 // Converts to/from internal values. The meaning of the "internal value" is
342 // completely up to the implementation, so it should be treated as opaque. 345 // completely up to the implementation, so it should be treated as opaque.
343 static TimeTicks FromInternalValue(int64_t value) { 346 static TimeTicks FromInternalValue(int64_t value) {
344 return TimeTicks(value); 347 return TimeTicks(value);
345 } 348 }
346 int64_t ToInternalValue() const { 349 int64_t ToInternalValue() const {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 int64_t ticks_; 407 int64_t ticks_;
405 }; 408 };
406 409
407 inline TimeTicks operator+(const TimeDelta& delta, const TimeTicks& ticks) { 410 inline TimeTicks operator+(const TimeDelta& delta, const TimeTicks& ticks) {
408 return ticks + delta; 411 return ticks + delta;
409 } 412 }
410 413
411 } } // namespace v8::internal 414 } } // namespace v8::internal
412 415
413 #endif // V8_PLATFORM_TIME_H_ 416 #endif // V8_PLATFORM_TIME_H_
OLDNEW
« no previous file with comments | « src/platform/elapsed-timer.h ('k') | src/platform/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698