Skip to content

Instantly share code, notes, and snippets.

@straubt1
Created August 21, 2015 12:34
Show Gist options
  • Save straubt1/0a97b67f03aed3af2e54 to your computer and use it in GitHub Desktop.
Save straubt1/0a97b67f03aed3af2e54 to your computer and use it in GitHub Desktop.
AOPinIoC_TimingAspect
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