public static Log ( MethodBase methodBase, long milliseconds ) : void | ||
methodBase | MethodBase | |
milliseconds | long | |
리턴 | void |
public void WithWeavingInterceptor() { var stopwatch = Stopwatch.StartNew(); try { //Some code u are curious how long it takes Console.WriteLine("Hello"); } finally { stopwatch.Stop(); MethodTimeLogger.Log(typeof(Template), stopwatch.ElapsedMilliseconds); } }
public void MethodWithThis_Expected(string fileName, int id) { var stopwatch = Stopwatch.StartNew(); try { Thread.Sleep(10); } finally { stopwatch.Stop(); var methodTimerMessage = string.Format("Current object: '{0}' | File name '{1}' with id '{2}'", new object[] { this, fileName, id }); MethodTimeLogger.Log(null, stopwatch.ElapsedMilliseconds, methodTimerMessage); } }