瀏覽代碼

added stamp()

Nicolas Cannasse 19 年之前
父節點
當前提交
a92ee20675
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      std/haxe/Timer.hx

+ 11 - 0
std/haxe/Timer.hx

@@ -78,4 +78,15 @@ class Timer {
 		};
 	}
 
+	public static function stamp() : Float {
+		#if flash
+		return flash.Lib.getTimer() / 1000;
+		#else neko
+		return neko.Sys.time();
+		#else js
+		return Date.now().getTime() / 1000;
+		#else error
+		#end
+	}
+
 }