Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move onload outside of applet-loading fn in perf/index.html.

  • Loading branch information...
commit 8ff8fe16e7c85a38b29b3af7218b832803c75774 1 parent 6e835a4
@slevithan authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 tests/perf/index.html
View
10 tests/perf/index.html
@@ -30,8 +30,10 @@
<script src="lib/benchmark.js"></script>
<script src="perf.js"></script>
+
<script>
- // Benchmark initialization adapted from Lo-Dash <http://lodash.com/> performance tests...
+ // Load an applet for higher-precision timing if needed and not manually disabled.
+ // Adapted from Lo-Dash <http://lodash.com/> performance tests...
(function() {
if (/[?&]nojava=true(?:&|$)/.test(location.search)) {
return;
@@ -43,12 +45,12 @@
while (!(measured = new Date - begin)) {
// No-op
}
- if (measured !== 1 && !(perf && typeof (perf.now || perf.webkitNow) === 'function')) {
- // Load the Java applet for higher-precision timing
+ if (measured !== 1 && !(perf && (perf.now || perf.webkitNow))) {
document.write('<applet code="nano" archive="lib/nano.jar"></applet>');
}
- onload = run;
}());
+
+ onload = run;
</script>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.