Sleep function

Make javascript sleep for x number of miliseconds.