0

In Windows, I've used QueryPerformanceCounter to measure code performance in microseconds. I would like to do the same in all platforms within Firemonkey. I found one solution, but it's only for C++.

What's the equivalent for all platforms?

Community
  • 1
  • 1
Jerry Dodge
  • 26,404
  • 28
  • 152
  • 313

1 Answers1

7

Use TStopwatch from System.Diagnostics.

  • On Windows it is implemented with QueryPerformanceCounter.
  • On Mac OS it is implemented with mach_absolute_time.
  • On POSIX platforms it is implemented with clock_gettime.
David Heffernan
  • 587,191
  • 41
  • 1,025
  • 1,442