<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176973] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176973">176973</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-12-08 14:17:03 -0800 (Mon, 08 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
https://bugs.webkit.org/show_bug.cgi?id=139410

Reviewed by Andreas Kling.

Source/JavaScriptCore:

* API/JSContextRef.cpp:
(JSContextGroupSetExecutionTimeLimit):
(JSContextGroupClearExecutionTimeLimit):
* runtime/Watchdog.cpp:
(JSC::Watchdog::setTimeLimit):
(JSC::Watchdog::didFire):
(JSC::Watchdog::startCountdownIfNeeded):
(JSC::Watchdog::startCountdown):
* runtime/Watchdog.h:
* runtime/WatchdogMac.cpp:
(JSC::Watchdog::startTimer):

Source/WTF:

* wtf/CurrentTime.cpp:
(WTF::currentCPUTime):
(WTF::currentCPUTimeMS): Deleted.
* wtf/CurrentTime.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSContextRefcpp">trunk/Source/JavaScriptCore/API/JSContextRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWatchdogcpp">trunk/Source/JavaScriptCore/runtime/Watchdog.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWatchdogh">trunk/Source/JavaScriptCore/runtime/Watchdog.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWatchdogMaccpp">trunk/Source/JavaScriptCore/runtime/WatchdogMac.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWatchdogNonecpp">trunk/Source/JavaScriptCore/runtime/WatchdogNone.cpp</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfCurrentTimecpp">trunk/Source/WTF/wtf/CurrentTime.cpp</a></li>
<li><a href="#trunkSourceWTFwtfCurrentTimeh">trunk/Source/WTF/wtf/CurrentTime.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSContextRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSContextRef.cpp (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSContextRef.cpp        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/API/JSContextRef.cpp        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -99,9 +99,9 @@
</span><span class="cx">     Watchdog&amp; watchdog = *vm.watchdog;
</span><span class="cx">     if (callback) {
</span><span class="cx">         void* callbackPtr = reinterpret_cast&lt;void*&gt;(callback);
</span><del>-        watchdog.setTimeLimit(vm, limit, internalScriptTimeoutCallback, callbackPtr, callbackData);
</del><ins>+        watchdog.setTimeLimit(vm, std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::duration&lt;double&gt;(limit)), internalScriptTimeoutCallback, callbackPtr, callbackData);
</ins><span class="cx">     } else
</span><del>-        watchdog.setTimeLimit(vm, limit);
</del><ins>+        watchdog.setTimeLimit(vm, std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::duration&lt;double&gt;(limit)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef group)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     if (!vm.watchdog)
</span><span class="cx">         vm.watchdog = std::make_unique&lt;Watchdog&gt;();
</span><span class="cx">     Watchdog&amp; watchdog = *vm.watchdog;
</span><del>-    watchdog.setTimeLimit(vm, std::numeric_limits&lt;double&gt;::infinity());
</del><ins>+    watchdog.setTimeLimit(vm, std::chrono::microseconds::max());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // From the API's perspective, a global context remains alive iff it has been JSGlobalContextRetained.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-12-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
+        https://bugs.webkit.org/show_bug.cgi?id=139410
+
+        Reviewed by Andreas Kling.
+
+        * API/JSContextRef.cpp:
+        (JSContextGroupSetExecutionTimeLimit):
+        (JSContextGroupClearExecutionTimeLimit):
+        * runtime/Watchdog.cpp:
+        (JSC::Watchdog::setTimeLimit):
+        (JSC::Watchdog::didFire):
+        (JSC::Watchdog::startCountdownIfNeeded):
+        (JSC::Watchdog::startCountdown):
+        * runtime/Watchdog.h:
+        * runtime/WatchdogMac.cpp:
+        (JSC::Watchdog::startTimer):
+
</ins><span class="cx"> 2014-12-08  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CFA wrongly assumes that a speculation for SlowPutArrayStorageShape disallows ArrayStorageShape arrays.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWatchdogcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Watchdog.cpp (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Watchdog.cpp        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/runtime/Watchdog.cpp        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-#define NO_LIMIT std::numeric_limits&lt;double&gt;::infinity()
</del><ins>+#define NO_LIMIT std::chrono::microseconds::max()
</ins><span class="cx"> 
</span><span class="cx"> Watchdog::Watchdog()
</span><span class="cx">     : m_timerDidFire(false)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     destroyTimer();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Watchdog::setTimeLimit(VM&amp; vm, double limit,
</del><ins>+void Watchdog::setTimeLimit(VM&amp; vm, std::chrono::microseconds limit,
</ins><span class="cx">     ShouldTerminateCallback callback, void* data1, void* data2)
</span><span class="cx"> {
</span><span class="cx">     bool wasEnabled = isEnabled();
</span><span class="lines">@@ -97,9 +97,9 @@
</span><span class="cx">     m_timerDidFire = false;
</span><span class="cx">     stopCountdown();
</span><span class="cx"> 
</span><del>-    double currentTime = currentCPUTime();
-    double deltaTime = currentTime - m_startTime;
-    double totalElapsedTime = m_elapsedTime + deltaTime;
</del><ins>+    auto currentTime = currentCPUTime();
+    auto deltaTime = currentTime - m_startTime;
+    auto totalElapsedTime = m_elapsedTime + deltaTime;
</ins><span class="cx">     if (totalElapsedTime &gt; m_limit) {
</span><span class="cx">         // Case 1: the allowed CPU time has elapsed.
</span><span class="cx"> 
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Tell the timer to alarm us again when it thinks we've reached the
</span><span class="cx">         // end of the allowed time.
</span><del>-        double remainingTime = m_limit - totalElapsedTime;
</del><ins>+        auto remainingTime = m_limit - totalElapsedTime;
</ins><span class="cx">         m_elapsedTime = totalElapsedTime;
</span><span class="cx">         m_startTime = currentTime;
</span><span class="cx">         startCountdown(remainingTime);
</span><span class="lines">@@ -164,13 +164,13 @@
</span><span class="cx">         return; // Not executing JS script. No need to start.
</span><span class="cx"> 
</span><span class="cx">     if (isEnabled()) {
</span><del>-        m_elapsedTime = 0;
</del><ins>+        m_elapsedTime = std::chrono::microseconds::zero();
</ins><span class="cx">         m_startTime = currentCPUTime();
</span><span class="cx">         startCountdown(m_limit);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Watchdog::startCountdown(double limit)
</del><ins>+void Watchdog::startCountdown(std::chrono::microseconds limit)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_isStopped);
</span><span class="cx">     m_isStopped = false;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWatchdogh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Watchdog.h (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Watchdog.h        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/runtime/Watchdog.h        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     ~Watchdog();
</span><span class="cx"> 
</span><span class="cx">     typedef bool (*ShouldTerminateCallback)(ExecState*, void* data1, void* data2);
</span><del>-    void setTimeLimit(VM&amp;, double seconds, ShouldTerminateCallback = 0, void* data1 = 0, void* data2 = 0);
</del><ins>+    void setTimeLimit(VM&amp;, std::chrono::microseconds limit, ShouldTerminateCallback = 0, void* data1 = 0, void* data2 = 0);
</ins><span class="cx"> 
</span><span class="cx">     // This version of didFire() will check the elapsed CPU time and call the
</span><span class="cx">     // callback (if needed) to determine if the watchdog should fire.
</span><span class="lines">@@ -63,14 +63,14 @@
</span><span class="cx">     void arm();
</span><span class="cx">     void disarm();
</span><span class="cx">     void startCountdownIfNeeded();
</span><del>-    void startCountdown(double limit);
</del><ins>+    void startCountdown(std::chrono::microseconds limit);
</ins><span class="cx">     void stopCountdown();
</span><span class="cx">     bool isArmed() { return !!m_reentryCount; }
</span><span class="cx"> 
</span><span class="cx">     // Platform specific timer implementation:
</span><span class="cx">     void initTimer();
</span><span class="cx">     void destroyTimer();
</span><del>-    void startTimer(double limit);
</del><ins>+    void startTimer(std::chrono::microseconds limit);
</ins><span class="cx">     void stopTimer();
</span><span class="cx"> 
</span><span class="cx">     // m_timerDidFire (above) indicates whether the timer fired. The Watchdog
</span><span class="lines">@@ -81,10 +81,9 @@
</span><span class="cx">     bool m_timerDidFire;
</span><span class="cx">     bool m_didFire;
</span><span class="cx"> 
</span><del>-    // All time units are in seconds.
-    double m_limit;
-    double m_startTime;
-    double m_elapsedTime;
</del><ins>+    std::chrono::microseconds m_limit;
+    std::chrono::microseconds m_startTime;
+    std::chrono::microseconds m_elapsedTime;
</ins><span class="cx"> 
</span><span class="cx">     int m_reentryCount;
</span><span class="cx">     bool m_isStopped;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWatchdogMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WatchdogMac.cpp (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WatchdogMac.cpp        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/runtime/WatchdogMac.cpp        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">         dispatch_release(m_queue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Watchdog::startTimer(double limit)
</del><ins>+void Watchdog::startTimer(std::chrono::microseconds limit)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_timer);
</span><span class="cx">     if (!m_queue)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     m_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, m_queue);
</span><span class="cx"> 
</span><span class="cx">     dispatch_source_set_timer(m_timer,
</span><del>-        dispatch_time(DISPATCH_TIME_NOW, limit * NSEC_PER_SEC),
</del><ins>+        dispatch_time(DISPATCH_TIME_NOW, std::chrono::nanoseconds(limit).count()),
</ins><span class="cx">         DISPATCH_TIME_FOREVER, 0);
</span><span class="cx"> 
</span><span class="cx">     dispatch_source_set_event_handler(m_timer, ^{
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWatchdogNonecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WatchdogNone.cpp (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WatchdogNone.cpp        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/JavaScriptCore/runtime/WatchdogNone.cpp        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Watchdog::startTimer(double)
</del><ins>+void Watchdog::startTimer(std::chrono::microseconds)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/WTF/ChangeLog        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-12-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
+        https://bugs.webkit.org/show_bug.cgi?id=139410
+
+        Reviewed by Andreas Kling.
+
+        * wtf/CurrentTime.cpp:
+        (WTF::currentCPUTime):
+        (WTF::currentCPUTimeMS): Deleted.
+        * wtf/CurrentTime.h:
+
</ins><span class="cx"> 2014-12-08  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Revert r176293 &amp; r176275
</span></span></pre></div>
<a id="trunkSourceWTFwtfCurrentTimecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CurrentTime.cpp (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CurrentTime.cpp        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/WTF/wtf/CurrentTime.cpp        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-double currentCPUTime()
</del><ins>+std::chrono::microseconds currentCPUTime()
</ins><span class="cx"> {
</span><span class="cx"> #if OS(DARWIN)
</span><span class="cx">     mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
</span><span class="lines">@@ -304,11 +304,8 @@
</span><span class="cx">     mach_port_t threadPort = mach_thread_self();
</span><span class="cx">     thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast&lt;thread_info_t&gt;(&amp;info), &amp;infoCount);
</span><span class="cx">     mach_port_deallocate(mach_task_self(), threadPort);
</span><del>-    
-    double time = info.user_time.seconds + info.user_time.microseconds / 1000000.;
-    time += info.system_time.seconds + info.system_time.microseconds / 1000000.;
-    
-    return time;
</del><ins>+
+    return std::chrono::seconds(info.user_time.seconds + info.system_time.seconds) + std::chrono::microseconds(info.user_time.microseconds + info.system_time.microseconds);
</ins><span class="cx"> #elif OS(WINDOWS)
</span><span class="cx">     union {
</span><span class="cx">         FILETIME fileTime;
</span><span class="lines">@@ -320,20 +317,14 @@
</span><span class="cx">     FILETIME creationTime, exitTime;
</span><span class="cx">     
</span><span class="cx">     GetThreadTimes(GetCurrentThread(), &amp;creationTime, &amp;exitTime, &amp;kernelTime.fileTime, &amp;userTime.fileTime);
</span><del>-    
-    return userTime.fileTimeAsLong / 10000000. + kernelTime.fileTimeAsLong / 10000000.;
</del><ins>+
+    return std::chrono::microseconds((userTime.fileTimeAsLong + kernelTime.fileTimeAsLong) / 10);
</ins><span class="cx"> #else
</span><span class="cx">     // FIXME: We should return the time the current thread has spent executing.
</span><span class="cx"> 
</span><del>-    // use a relative time from first call in order to avoid an overflow
-    static double firstTime = currentTime();
-    return currentTime() - firstTime;
</del><ins>+    static auto firstTime = std::chrono::steady_clock::now();
+    return std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::steady_clock::now() - firstTime);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double currentCPUTimeMS()
-{
-    return currentCPUTime() * 1000;
-}
-
</del><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWTFwtfCurrentTimeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CurrentTime.h (176972 => 176973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CurrentTime.h        2014-12-08 22:12:25 UTC (rev 176972)
+++ trunk/Source/WTF/wtf/CurrentTime.h        2014-12-08 22:17:03 UTC (rev 176973)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #ifndef CurrentTime_h
</span><span class="cx"> #define CurrentTime_h
</span><span class="cx"> 
</span><ins>+#include &lt;chrono&gt;
</ins><span class="cx"> #include &lt;time.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -55,14 +56,11 @@
</span><span class="cx"> // NTP or manual adjustments, so it is better suited for elapsed time measurement.
</span><span class="cx"> WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><del>-// Returns the current CPU time of the current thread in seconds.
</del><ins>+// Returns the current CPU time of the current thread.
</ins><span class="cx"> // Precision varies depending on platform but is usually as good or better
</span><span class="cx"> // than a millisecond.
</span><del>-WTF_EXPORT_PRIVATE double currentCPUTime();
</del><ins>+WTF_EXPORT_PRIVATE std::chrono::microseconds currentCPUTime();
</ins><span class="cx"> 
</span><del>-// Returns the current CPU time of the current thread in milliseconds.
-WTF_EXPORT_PRIVATE double currentCPUTimeMS();
-
</del><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><span class="cx"> using WTF::currentTime;
</span></span></pre>
</div>
</div>

</body>
</html>