Created
July 18, 2014 07:52
-
-
Save khellang/c28627caea31f6ee3323 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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