<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div>
<button onclick="test()">dianji</button>
</div>
<script>
setTimeout(function () {
alert("timer handler")
}, 2000)
function test () {
document.addEventListener("click", function (e) {
alert("click handler")
}, false)
var startTime = new Date()
while ((new Date()).getTime() - startTime < 5000){}
}
</script>
</body>
</html>