Skip to content
/ Duration Public

Some .Net code to track how long things take in a `using` statement

License

Notifications You must be signed in to change notification settings

a-h/Duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duration

Some .Net code to track how long things take in a using statement

Usage

using (new DurationLogger((msg) => _logger.Debug(msg), "code_section.login"))
{
  // Do something that takes a long time, like make a HTTP request.
}

The argument passed to logging lambda expression will be:

code_section.login=5ms

One way to use this is to pass a function that logs to a log4net logger.

About

Some .Net code to track how long things take in a `using` statement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages