Why is Timer's "read_ms" method deprecated in the upcoming Mbed OS 6?

there is another good document about the Mbed clocks:
https://github.com/ARMmbed/mbed-os/blob/master/docs/design-documents/platform/clocks/clocks.md

for checking elapsed time, it is not necessary to use a Timer instance. With this snippet from the document it is easy:

//Measuring elapsed time via the RTOS

auto start = Kernel::Clock::now(); // type will be Kernel::Clock::time_point
do_operation();
milliseconds elapsed_time = Kernel::Clock::now() - start;
printf("elapsed time = %d ms\n", int(elapsed_time.count()));

or checking the timepoint:

  if (Kernel::Clock::now() - start < 100ms)
    return;

chrono is great stuff, but like a landslide in Mbed :slight_smile:
There are plenty of interfaces that are still using legacy integers.

2 Likes