az_platform_clock_msec POSIX implementation #2364
Labels
Azure.Core
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
az_posix.c
implements theaz_platform_clock_msec
by measuring CPU time, not wall time. This API isn't used today.In ANSI C/POSIX, clock_t clock() is to approximate the CPU time spent in a process and the current naming creates confusion.
A few ways to fix this:
clock_gettime()
clock_getres()
. The problem is that POSIX doesn't guarantee availability of (all) timing functions. We'll need runtime code to discover enabled functionality.time()
epoch timer with 1 second accuracy.Also, please consider the API breaking change to rename the API name to
AZ_NODISCARD az_result az_platform_time_msec(int64_t* out_clock_msec)
to further reduce confusion on the purpose of the API.The text was updated successfully, but these errors were encountered: