~yolanda.robla/ubuntu/trusty/nodejs/add_distribution

« back to all changes in this revision

Viewing changes to benchmark/settimeout.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
console.log("wait...");
2
 
var done = 0;
3
 
var N = 5000000;
4
 
var begin = new Date();
5
 
for (var i = 0; i < N; i++) {
6
 
  setTimeout(function () {
7
 
    if (++done == N) {
8
 
      var end = new Date();
9
 
      console.log("smaller is better");
10
 
      console.log("startup: %d", start - begin);
11
 
      console.log("done: %d", end - start);
12
 
    }
13
 
  }, 1000);
14
 
}
15
 
var start = new Date();