const tools = require('./sync'), task1 = tools.task1, task2 = tools.task2, task3 = tools.task3; task1(); task2(); task3();
function1 -- starting function1 -- working function1 -- working function1 -- working function1 -- finished function2 -- starting function2 -- working function2 -- working function2 -- working function2 -- finished function3 -- starting function3 -- working function3 -- working function3 -- working function3 -- finished
const tools = require('./async'), task1 = tools.task1, task2 = tools.task2, task3 = tools.task3; task1(); task2(); task3();
task1 -- starting task2 -- starting task3 -- starting task1 -- working task2 -- working task3 -- working task1 -- working task2 -- working task3 -- working task1 -- working task1 -- finished task2 -- working task2 -- finished task3 -- working task3 -- finished