Created
August 25, 2021 16:59
-
-
Save stemount/66520203175383f16468d93a009a8974 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const t1 = performance.now(); | |
let count_y = 0; | |
let count_n = 0; | |
for (let i = 0; i < 10_000; i++) { | |
let message = `!play ${i}`; | |
if (/^!(play|playball|givecompliment)(?:\s+(\w+))?$/.test(message)) | |
count_y += 1; | |
else | |
count_n += 1; | |
} | |
const done = performance.now() - t1; | |
console.log('Took', done, 'found', count_y, 'not_found', count_n); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment