P
Peter
Hi
I have a class which implements IDisposable, but it doesn't really use
the Dispose method for cleaning up resources, it uses it for completing
a calculation.
Actually I think it seems quite smart (I think there are other problems
with the class though) but I was wondering if this was stretching the
use/meaning of IDisposable a bit?
The class is used as part of a module for timing method calls, and you
would use it like:
using (MyTimer timer = new MyTimer("timername"))
{
// Do stuff which needs timing....
} // At the end of the "using", the MyTimer stops its timing
// Get some timing statistics from static method:
double msec = MyTimer.GetMilliseconds("timername");
regards,
Peter
I have a class which implements IDisposable, but it doesn't really use
the Dispose method for cleaning up resources, it uses it for completing
a calculation.
Actually I think it seems quite smart (I think there are other problems
with the class though) but I was wondering if this was stretching the
use/meaning of IDisposable a bit?
The class is used as part of a module for timing method calls, and you
would use it like:
using (MyTimer timer = new MyTimer("timername"))
{
// Do stuff which needs timing....
} // At the end of the "using", the MyTimer stops its timing
// Get some timing statistics from static method:
double msec = MyTimer.GetMilliseconds("timername");
regards,
Peter