<script>
setTimeout(function () {
document.write('Awake!')
}, prompt("Number of milliseconds to sleep"));
document.write('Sleeping... ');
</script>