Created
August 21, 2015 12:34
-
-
Save straubt1/0a97b67f03aed3af2e54 to your computer and use it in GitHub Desktop.
AOPinIoC_TimingAspect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimingAspect : Aspect | |
{ | |
public override void ProcessInvocation(IInvocation invocation) | |
{ | |
var sw = Stopwatch.StartNew(); | |
invocation.Proceed(); | |
sw.Stop(); | |
Console.WriteLine("({0})Elapsed: {1}", invocation.MethodInvocationTarget.Name, sw.Elapsed); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment