Javascript goes out of it's way to avoid blocking the event loop. As such writing a function that purposely blocks the loop for a given time is very unnatural.
Having said that, and only if you promise never to use it for anything other than a demonstrations, you can do something like this:
function fun1(){
console.log("done in fun1")
return
}
function fun3(){
console.log("done in fun3")
return
}
function fun2(){
var then = new Date().getTime() + 5000;
// wait five seconds the hard way
while(new Date().getTime() < then) {
};
console.log("done in fun2")
return
}
fun1()
fun2()
fun3()