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

Side by Side Diff: chrome/browser/resources/net_internals/time_util.js

Issue 8474001: Add a timeline view to about:net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Comment fix Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var timeutil = (function() { 5 var timeutil = (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Offset needed to convert event times to Date objects. 9 * Offset needed to convert event times to Date objects.
10 * Updated whenever constants are loaded. 10 * Updated whenever constants are loaded.
(...skipping 14 matching lines...) Expand all
25 * This function converts the tick count to a Date() object. 25 * This function converts the tick count to a Date() object.
26 * 26 *
27 * @param {String} timeTicks. 27 * @param {String} timeTicks.
28 * @returns {Date} The time that |timeTicks| represents. 28 * @returns {Date} The time that |timeTicks| represents.
29 */ 29 */
30 function convertTimeTicksToDate(timeTicks) { 30 function convertTimeTicksToDate(timeTicks) {
31 var timeStampMs = timeTickOffset + (timeTicks - 0); 31 var timeStampMs = timeTickOffset + (timeTicks - 0);
32 return new Date(timeStampMs); 32 return new Date(timeStampMs);
33 } 33 }
34 34
35 /**
36 * Returns the current time.
37 *
38 * @returns {number} Milliseconds since the Unix epoch.
39 */
40 function getCurrentTime() {
41 return (new Date()).getTime();
42 }
43
35 return { 44 return {
36 setTimeTickOffset: setTimeTickOffset, 45 setTimeTickOffset: setTimeTickOffset,
37 convertTimeTicksToDate: convertTimeTicksToDate 46 convertTimeTicksToDate: convertTimeTicksToDate,
47 getCurrentTime: getCurrentTime
38 }; 48 };
39 })(); 49 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/test_view.js ('k') | chrome/browser/resources/net_internals/timeline_data_series.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698