Stopwatch class for performance measurements