例如
foo() //Some operation bound by an external resource. db,I/O,whatever.
与
var watch = new Stopwatch(); watch.Start(); foo() var time = watch.ElapsedMilliseconds watch.Stop();