Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Statically logging method call latencies
interface IDoWork {
void DoThis();
string WhatsThat(int that);
}
class DoWork : IDoWork {
public void DoThis() {
Log.Action("DoWork.DoThis", () => DoThisImpl() );
}
public string WhatsThat(int that) {
return Log.Func("DidWork.ChangedTheNameForgotTheString", () => "It is " + that);
}
}
// assuming Log.Method is a way to run the given Action/Func,
// meter the latency keyed by method, and do something with the data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.