Fix profileKiss. Close #179
This commit is contained in:
@@ -173,8 +173,7 @@ class AsyncEmbeddedScript {
|
|||||||
k.fieldList = [];
|
k.fieldList = [];
|
||||||
Kiss._try(() -> {
|
Kiss._try(() -> {
|
||||||
#if profileKiss
|
#if profileKiss
|
||||||
haxe.Timer.measure(() -> {
|
Kiss.measure('Compiling kiss: $scriptFile', () -> {
|
||||||
trace(scriptFile);
|
|
||||||
#end
|
#end
|
||||||
Reader.readAndProcess(Stream.fromFile(scriptFile), k, (nextExp) -> {
|
Reader.readAndProcess(Stream.fromFile(scriptFile), k, (nextExp) -> {
|
||||||
var exprString = Reader.toString(nextExp.def);
|
var exprString = Reader.toString(nextExp.def);
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ class EmbeddedScript {
|
|||||||
|
|
||||||
Kiss._try(() -> {
|
Kiss._try(() -> {
|
||||||
#if profileKiss
|
#if profileKiss
|
||||||
haxe.Timer.measure(() -> {
|
Kiss.measure('Compiling kiss: $scriptFile', () -> {
|
||||||
trace(scriptFile);
|
|
||||||
#end
|
#end
|
||||||
Reader.readAndProcess(Stream.fromFile(scriptFile), k, (nextExp) -> {
|
Reader.readAndProcess(Stream.fromFile(scriptFile), k, (nextExp) -> {
|
||||||
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
|
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
|
||||||
|
|||||||
@@ -324,8 +324,7 @@ class Kiss {
|
|||||||
|
|
||||||
return _try(() -> {
|
return _try(() -> {
|
||||||
#if profileKiss
|
#if profileKiss
|
||||||
haxe.Timer.measure(() -> {
|
Kiss.measure('Compiling kiss: $kissFile', () -> {
|
||||||
trace(kissFile);
|
|
||||||
#end
|
#end
|
||||||
if (k == null)
|
if (k == null)
|
||||||
k = defaultKissState(context);
|
k = defaultKissState(context);
|
||||||
@@ -767,5 +766,14 @@ class Kiss {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function measure<T>(processLabel:String, process:Void->T) {
|
||||||
|
var start = Sys.time();
|
||||||
|
Sys.print('${processLabel}... ');
|
||||||
|
var result = process();
|
||||||
|
var end = Sys.time();
|
||||||
|
Sys.println('${end-start}s');
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user