首页 > 代码库 > sleep

sleep

function sleep(numberMillis) {

        var now = new Date();

        var exitTime = now.getTime() + numberMillis;

        while (true) {

            now = new Date();

            if (now.getTime() > exitTime)

                return;

        }

    }