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>

posted @ 2014-11-01 17:26  静坐观雨  阅读(111)  评论(0编辑  收藏  举报