diff --git a/ARES-6/Air/util.js b/ARES-6/Air/util.js index a2c7de9b..712d9997 100644 --- a/ARES-6/Air/util.js +++ b/ARES-6/Air/util.js @@ -168,12 +168,3 @@ function bubbleSort(array, lessThan) end--; } } - -let currentTime; -if (this.performance && performance.now) - currentTime = function() { return performance.now() }; -else if (this.preciseTime) - currentTime = function() { return preciseTime() * 1000; }; -else - currentTime = function() { return +new Date(); }; - diff --git a/ARES-6/Basic/util.js b/ARES-6/Basic/util.js deleted file mode 100644 index b6120502..00000000 --- a/ARES-6/Basic/util.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2016 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -"use strict"; - -let currentTime; -if (this.performance && performance.now) - currentTime = function() { return performance.now() }; -else if (this.preciseTime) - currentTime = function() { return preciseTime() * 1000; }; -else - currentTime = function() { return +new Date(); }; - diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 21b16394..8b81aab2 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -1472,7 +1472,6 @@ let BENCHMARKS = [ "./ARES-6/Basic/parser.js", "./ARES-6/Basic/random.js", "./ARES-6/Basic/state.js", - "./ARES-6/Basic/util.js", "./ARES-6/Basic/benchmark.js", ], tags: ["Default", "ARES"], diff --git a/RexBench/benchmark.js b/RexBench/benchmark.js index 95030043..5e6ef2be 100644 --- a/RexBench/benchmark.js +++ b/RexBench/benchmark.js @@ -24,14 +24,6 @@ */ "use strict"; -let currentTime; -if (this.performance && performance.now) - currentTime = function() { return performance.now() }; -else if (this.preciseTime) - currentTime = function() { return preciseTime() * 1000; }; -else - currentTime = function() { return +new Date(); }; - class Benchmark { constructor(verbose = 0) { @@ -43,9 +35,9 @@ class Benchmark { this.setup(); for (let iteration = 0; iteration < numIterations; ++iteration) { - let before = currentTime(); + let before = performance.now(); this.runOnce(); - let after = currentTime(); + let after = performance.now(); results.push(after - before); } diff --git a/cdjs/benchmark.js b/cdjs/benchmark.js index a4d19cbf..533d4bdd 100644 --- a/cdjs/benchmark.js +++ b/cdjs/benchmark.js @@ -32,7 +32,7 @@ function benchmarkImpl(configuration) { var simulator = new Simulator(numAircraft); var detector = new CollisionDetector(); - var lastTime = currentTime(); + var lastTime = performance.now(); var results = []; for (var i = 0; i < numFrames; ++i) { var time = i / 10; @@ -40,7 +40,7 @@ function benchmarkImpl(configuration) { var collisions = detector.handleNewFrame(simulator.simulate(time)); var before = lastTime; - var after = currentTime(); + var after = performance.now(); lastTime = after; var result = { time: after - before, diff --git a/cdjs/util.js b/cdjs/util.js index 69542e83..02a6e513 100644 --- a/cdjs/util.js +++ b/cdjs/util.js @@ -73,10 +73,3 @@ function averageAbovePercentile(numbers, percentile) { return result; } -var currentTime; -if (this.performance && performance.now) - currentTime = function() { return performance.now() }; -else if (preciseTime) - currentTime = function() { return preciseTime() * 1000; }; -else - currentTime = function() { return 0 + new Date(); };