Changeset 228533 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Feb 15, 2018, 2:34:16 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r228488 r228533 81 81 #include <type_traits> 82 82 #include <wtf/CommaPrinter.h> 83 #include <wtf/CurrentTime.h>84 83 #include <wtf/MainThread.h> 85 84 #include <wtf/NeverDestroyed.h> 86 85 #include <wtf/StringPrintStream.h> 86 #include <wtf/WallTime.h> 87 87 #include <wtf/text/StringBuilder.h> 88 88 … … 410 410 411 411 private: 412 double m_startTime;413 double m_stopTime;412 MonotonicTime m_startTime; 413 MonotonicTime m_stopTime; 414 414 }; 415 415 416 416 void StopWatch::start() 417 417 { 418 m_startTime = monotonicallyIncreasingTime();418 m_startTime = MonotonicTime::now(); 419 419 } 420 420 421 421 void StopWatch::stop() 422 422 { 423 m_stopTime = monotonicallyIncreasingTime();423 m_stopTime = MonotonicTime::now(); 424 424 } 425 425 426 426 long StopWatch::getElapsedMS() 427 427 { 428 return static_cast<long>((m_stopTime - m_startTime) * 1000);428 return (m_stopTime - m_startTime).millisecondsAs<long>(); 429 429 } 430 430 … … 1378 1378 EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*) 1379 1379 { 1380 return JSValue::encode(jsNumber( currentTime()));1380 return JSValue::encode(jsNumber(WallTime::now().secondsSinceEpoch().value())); 1381 1381 } 1382 1382 … … 2650 2650 std::sort(compileTimeKeys.begin(), compileTimeKeys.end()); 2651 2651 for (CString key : compileTimeKeys) 2652 printf("%40s: %.3lf ms\n", key.data(), compileTimeStats.get(key) );2652 printf("%40s: %.3lf ms\n", key.data(), compileTimeStats.get(key).milliseconds()); 2653 2653 } 2654 2654 #endif
Note:
See TracChangeset
for help on using the changeset viewer.