Skip to content

Instantly share code, notes, and snippets.

@khellang
Created July 18, 2014 07:52
Show Gist options
  • Save khellang/c28627caea31f6ee3323 to your computer and use it in GitHub Desktop.
Save khellang/c28627caea31f6ee3323 to your computer and use it in GitHub Desktop.
using AppFunc = Func<IDictionary<string, object>, Task>;
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Use(new Func<AppFunc, AppFunc>(next => async env =>
{
var stopwatch = Stopwatch.StartNew();
await next.Invoke(env);
stopwatch.Stop();
// Write to log or something...
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment