支援舊版瀏覽器

在 Date.now() 不可用的舊瀏覽器中,請改用 (new Date()).getTime() :

t = (new Date()).getTime();

或者,要提供在舊版瀏覽器中使用的 Date.now() 函式,請使用此 polyfill :

if (!Date.now) {
  Date.now = function now() {
    return new Date().getTime();
  };
}