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

Unified Diff: chrome/browser/resources/net_internals/time_util.js

Issue 10825116: net-internals: Display time log dump was created at end of printed logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments - [dt=blah+], new timeutil method Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/net_internals/time_util.js
===================================================================
--- chrome/browser/resources/net_internals/time_util.js (revision 148858)
+++ chrome/browser/resources/net_internals/time_util.js (working copy)
@@ -22,14 +22,25 @@
/**
* The browser gives us times in terms of "time ticks" in milliseconds.
+ * This function converts the tick count to a Javascript "time", which is
+ * the UTC time in milliseconds.
+ *
+ * @param {String} timeTicks A time represented in "time ticks".
+ * @return {number} The Javascript time that |timeTicks| represents.
+ */
+ function convertTimeTicksToTime(timeTicks) {
+ return timeTickOffset + (timeTicks - 0);
+ }
+
+ /**
+ * The browser gives us times in terms of "time ticks" in milliseconds.
* This function converts the tick count to a Date() object.
*
* @param {String} timeTicks A time represented in "time ticks".
* @return {Date} The time that |timeTicks| represents.
*/
function convertTimeTicksToDate(timeTicks) {
- var timeStampMs = timeTickOffset + (timeTicks - 0);
- return new Date(timeStampMs);
+ return new Date(convertTimeTicksToTime(timeTicks));
}
/**
@@ -88,6 +99,7 @@
return {
setTimeTickOffset: setTimeTickOffset,
+ convertTimeTicksToTime: convertTimeTicksToTime,
convertTimeTicksToDate: convertTimeTicksToDate,
getCurrentTime: getCurrentTime,
addNodeWithDate: addNodeWithDate,

Powered by Google App Engine
This is Rietveld 408576698