FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/benchmark/run.js at master · objcode/node · GitHub
objcode
/
node
Public
forked from
nodejs/node-v0.x-archive
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
benchmark
/
run.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (28 loc) · 813 Bytes
Breadcrumbs
node
/
benchmark
/
run.js
Copy path
File metadata and controls
31 lines (28 loc) · 813 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var
path
=
require
(
"path"
)
;
var
sys
=
require
(
"sys"
)
;
var
childProcess
=
require
(
"child_process"
)
;
var
benchmarks
=
[
"timers.js"
,
"process_loop.js"
,
"static_http_server.js"
]
;
var
benchmarkDir
=
path
.
dirname
(
__filename
)
;
function
exec
(
script
,
callback
)
{
var
start
=
new
Date
(
)
;
var
child
=
childProcess
.
spawn
(
process
.
argv
[
0
]
,
[
path
.
join
(
benchmarkDir
,
script
)
]
)
;
child
.
addListener
(
"exit"
,
function
(
code
)
{
var
elapsed
=
new
Date
(
)
-
start
;
callback
(
elapsed
,
code
)
;
}
)
;
}
function
runNext
(
i
)
{
if
(
i
>=
benchmarks
.
length
)
return
;
sys
.
print
(
benchmarks
[
i
]
+
": "
)
;
exec
(
benchmarks
[
i
]
,
function
(
elapsed
,
code
)
{
if
(
code
!=
0
)
{
console
.
log
(
"ERROR "
)
;
}
console
.
log
(
elapsed
)
;
runNext
(
i
+
1
)
;
}
)
;
}
;
runNext
(
0
)
;
Back
|
FazBrowse Home
|
New Git URL