Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created January 25, 2010 01:27
Show Gist options
  • Save tolmasky/285563 to your computer and use it in GitHub Desktop.
Save tolmasky/285563 to your computer and use it in GitHub Desktop.
function code_block()
{
function print_something()
{
console.log(something);
}
date = new Date();
function task_1()
{
var something = long_operation();
print_something();
}();
if (new Date() - date > slow_script_interval)
window.setTimeout(task_2, 0);
else
task_2();
function task_2()
{
var something = long_operation();
print_something();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment