mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-20 11:11:08 +01:00
Merge pull request #10607 from gilles-peskine-arm/timing-use-mstime
Simplify MBEDTLS_TIMING_C to use mbedtls_ms_time()
This commit is contained in:
@@ -360,7 +360,9 @@ static unsigned elapsed_time(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mbedtls_timing_get_timer(&hires, 0);
|
||||
/* Wraps after ~49.7 days (assuming 32-bit int).
|
||||
* Don't run udp_proxy that long! */
|
||||
return (unsigned) mbedtls_timing_get_timer(&hires, 0);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -150,7 +150,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
mbedtls_printf(".");
|
||||
}
|
||||
ms = mbedtls_timing_get_timer(&timer, 0);
|
||||
/* On 64-bit Windows and 32-bit platforms, this wraps after about
|
||||
* 49.7 days. This shouldn't be a problem in practice. */
|
||||
ms = (unsigned long) mbedtls_timing_get_timer(&timer, 0);
|
||||
mbedtls_printf("\n%u iterations -> %lu ms\n", opt.iterations, ms);
|
||||
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user