From 82324352ad1b358dbcff98caf95278be33d406ce Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 2 Nov 2009 21:02:37 +0000 Subject: [PATCH] timing support --- .../src/org/aspectj/weaver/ShadowMunger.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java b/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java index d12942108..1b6dbbe6f 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java @@ -24,6 +24,7 @@ import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.SourceLocation; +import org.aspectj.util.FuzzyBoolean; import org.aspectj.util.PartialOrder; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.Pointcut; @@ -103,7 +104,16 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH } } } - return pointcut.match(shadow).maybeTrue(); + if (world.areInfoMessagesEnabled() && world.isTimingEnabled()) { + long starttime = System.nanoTime(); + FuzzyBoolean isMatch = pointcut.match(shadow); + long endtime = System.nanoTime(); + world.record(pointcut, endtime - starttime); + return isMatch.maybeTrue(); + } else { + FuzzyBoolean isMatch = pointcut.match(shadow); + return isMatch.maybeTrue(); + } } public int fallbackCompareTo(Object other) { -- 2.39.5