js测代码处理时间(js入门)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var start = Date.now();
for(var i = 0; i< 500000000; i++){}
var stop = Date.now();
var result = stop - start;
alert(result);
</script>
</head>
<body>
</body>
</html>