Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix time recording in tests

  • Loading branch information...
commit ca8dd5bdd622d15305b9a204ad3b83fd28344cd2 1 parent 630d7e3
@todesschaf todesschaf authored
Showing with 4 additions and 4 deletions.
  1. +4 −1 head.js
  2. +0 −3  tests/basic.js
View
5 head.js
@@ -18,7 +18,10 @@ var Cr = Components.results;
* Store some results for writing once we're all done
*/
function do_write_result(key, start, stop) {
- var val = {'start':start, 'stop':stop, 'total':stop - start};
+ var startms = start.valueOf();
+ var stopms = stop.valueOf();
+
+ var val = {'start':startms, 'stop':stopms, 'total':stopms - startms};
if (STONERIDGE_RESULTS.hasOwnProperty(key)) {
STONERIDGE_RESULTS[key].push(val);
View
3  tests/basic.js
@@ -15,7 +15,6 @@ listener = {
onDataAvailable: function() {
if (!firstDataTime) {
firstDataTime = new Date();
- firstDataTime = firstDataTime.getMilliseconds();
}
},
@@ -23,7 +22,6 @@ listener = {
//do_check(status === 0, "request to '" + request.name + "' failed");
endTime = new Date();
- endTime = endTime.getMilliseconds();
do_write_result("latency", startTime, firstDataTime);
do_write_result("data_delivery", firstDataTime, endTime);
@@ -36,7 +34,6 @@ listener = {
function run_test() // The entry point
{
startTime = new Date();
- startTime = startTime.getMilliseconds();
var channel = make_channel("http://example.org/");
channel.asyncOpen(listener, null);
}
Please sign in to comment.
Something went wrong with that request. Please try again.