zoukankan      html  css  js  c++  java
  • JS计时


       /*
        var obj = document.getElementById("times");

        var ms = 0;
        var state = 0;
        function startstop() {
            if (state == 0) {
                state = 1;
                then = new Date();
                then.setTime(then.getTime() - ms);
            } else {
                state = 0;
                now = new Date();
                ms = now.getTime() - then.getTime();
                obj.innerHTML = ms/1000;
            }
        } 
     
        function display() {
            setTimeout("display();", 50);
            if (state == 1) {
                now = new Date();
                ms = now.getTime() - then.getTime();
                obj.innerHTML = ms/1000;
            }
        }
       // window.onload = display
        window.onbeforeunload = function () {
            display();
            //alert('exit');
        }
        startstop();
        */

  • 相关阅读:
    C++输入cout与输出cin
    golang学习笔记
    vscode环境配置
    golang 微框架 gin
    git go使用socket5代理
    go包管理工具glide
    collectd的python插件(redis)
    zookeeper & kafka 集群
    redis复制集(sentinel)
    python加解密
  • 原文地址:https://www.cnblogs.com/itecho/p/2454820.html
Copyright © 2011-2022 走看看