Skip to content

Instantly share code, notes, and snippets.

@baoqger
Created May 29, 2020 02:43
Show Gist options
  • Save baoqger/1d256cc01ae71e438ae7bba465511160 to your computer and use it in GitHub Desktop.
Save baoqger/1d256cc01ae71e438ae7bba465511160 to your computer and use it in GitHub Desktop.
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