Browse Source

add Sys.cpuTime

frabbit 11 years ago
parent
commit
14ab5d65c6
2 changed files with 4 additions and 3 deletions
  1. 1 1
      std/python/_std/Sys.hx
  2. 3 2
      std/python/lib/Time.hx

+ 1 - 1
std/python/_std/Sys.hx

@@ -72,7 +72,7 @@ class Sys {
 	}
 	}
 
 
 	public static function cpuTime() : Float {
 	public static function cpuTime() : Float {
-		return 0.0;
+		return python.lib.Time.clock();
 	}
 	}
 
 
 	public static function executablePath() : String {
 	public static function executablePath() : String {

+ 3 - 2
std/python/lib/Time.hx

@@ -3,9 +3,10 @@ package python.lib;
 
 
 extern class Time {
 extern class Time {
 
 
-	public static function time ():Int;
+	public static function time ():Float;
+	public static function clock ():Float;
 	public static function sleep (t:Float):Void;
 	public static function sleep (t:Float):Void;
-	static function __init__ ():Void 
+	static function __init__ ():Void
 	{
 	{
 		python.Macros.importAs("time", "python.lib.Time");
 		python.Macros.importAs("time", "python.lib.Time");
 	}
 	}