Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4503334
microbench.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
376 B
Referenced Files
None
Subscribers
None
microbench.js
View Options
// Simple microbenchmark for function call overhead
function
add
(
a
,
b
)
{
return
a
+
b
;
}
const
iterations
=
200000
;
console
.
log
(
`Running
${
iterations
}
iterations...`
);
let
start
=
Date
.
now
();
let
result
=
0
;
for
(
let
i
=
0
;
i
<
iterations
;
i
++
)
{
result
+=
add
(
i
,
i
+
1
);
}
console
.
log
(
`Simple add:
${
Date
.
now
()
-
start
}
ms (result:
${
result
}
)`
);
console
.
log
(
"Done!"
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 9:25 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
523959
Default Alt Text
microbench.js (376 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment