|
@@ -585,6 +585,24 @@ class Context {
|
|
|
load("register_module_dependency", 2)(modulePath, externFile);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ Creates a timer which will be printed in the compilation report
|
|
|
+ if `--times` compilation argument is set.
|
|
|
+
|
|
|
+ Note that a timer may be omitted from the report if the amount of time
|
|
|
+ measured is too small.
|
|
|
+
|
|
|
+ This method immediately starts a timer and returns a function to stop it:
|
|
|
+ ```
|
|
|
+ var stopTimer = haxe.macro.Context.timer("my heavy task");
|
|
|
+ runTask();
|
|
|
+ stopTimer();
|
|
|
+ ```
|
|
|
+ **/
|
|
|
+ public static function timer(id:String):()->Void {
|
|
|
+ return load("timer", 1)(id);
|
|
|
+ }
|
|
|
+
|
|
|
@:deprecated
|
|
|
public static function registerModuleReuseCall(modulePath:String, macroCall:String) {
|
|
|
throw "This method is no longer supported. See https://github.com/HaxeFoundation/haxe/issues/5746";
|