Explorar o código

add Sys.cpuTime

frabbit %!s(int64=11) %!d(string=hai) anos
pai
achega
14ab5d65c6
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  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 {
-		return 0.0;
+		return python.lib.Time.clock();
 	}
 
 	public static function executablePath() : String {

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

@@ -3,9 +3,10 @@ package python.lib;
 
 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;
-	static function __init__ ():Void 
+	static function __init__ ():Void
 	{
 		python.Macros.importAs("time", "python.lib.Time");
 	}