JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = () => {
    setTimeout( function() {
        console.timeEnd( 'x' );
    }, 1000 );
    return Promise.resolve()
};

var y = () => {
    setTimeout( function() {
        console.timeEnd( 'y' );
    }, 1000 );
};

console.time('x')
console.time('y')
console.time('all done')

Promise.resolve().then(x).then(y).then((resolve, reject) => {
    console.timeEnd( 'all done' );
});