うるう年

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
ナイーブな実装
const isうるう都市 = year => (year % 4 == 0 && year % 100 > 0) || [200, 600].includes(year % 900)
for(let i=1; i<100000; i++) isうるう都市(i)
ready
ビット演算
const isうるう都市 = year => ((year & 3) != 0) ? false : ((year & 15) == 0) ? true : year % 25 != 0;
for(let i=1; i<100000; i++) isうるう都市(i)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.