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,858
  • 31
  • 155
  • 327

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
  • 601,492
  • 42
  • 1,072
  • 1,490