Why does the js code of this setTimeout work like this?

<!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>
Mar.03,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b308ff-2b26f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b308ff-2b26f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?