Sign in
chromium
/
external
/
github.com
/
WebKit
/
webkit
/
refs/heads/main
/
.
/
JSTests
/
microbenchmarks
/
string-pad-end-consume.js
blob: e5a9b5c9a6bc05e81f57917a80af3ccdb55b86f6 [
file
] [
edit
]
// padEnd a short string and consume the result via charCodeAt.
function
bench
()
{
let total
=
0
;
const
base
=
"hello"
;
for
(
let i
=
0
;
i
<
1e6
;
++
i
)
{
const
s
=
base
.
padEnd
(
80
);
total
+=
s
.
charCodeAt
(
79
);
}
return
total
;
}
noInline
(
bench
);
bench
();