Created
May 29, 2020 02:43
-
-
Save baoqger/1d256cc01ae71e438ae7bba465511160 to your computer and use it in GitHub Desktop.
This file contains 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
export function slowFunction(val: number): number { | |
const pre = new Date(); | |
while (true) { | |
const now = new Date(); | |
if (now.valueOf() - pre.valueOf() > 2000) { | |
break; | |
} | |
} | |
return val; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment