#include#include int main() { TStopwatch stopwatch; stopwatch.Start(); // do some time-consuming operation stopwatch.Print(); return 0; }
#includeIn this example, we create a function foo() that performs a time-consuming operation and prints the elapsed time using TStopwatch. Inside the main() function, we call foo() to execute the operation and print the elapsed time.#include void foo() { TStopwatch stopwatch; stopwatch.Start(); // do some time-consuming operation stopwatch.Print(); } int main() { foo(); return 0; }