On platforms where long is a 32-bit type (which includes 64-bit Windows), the internal counter used by timers defined by mbedtls_timing_set_delay() and mbedtls_timing_get_delay() wrap after 2^32 milliseconds, which is about 49.7 days. You can only set a delay of at most 2^32 ms, but if you wait more than 2^32 ms to query the timer, it may or may not be expired.