mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/benchmark: fix integer overflow in benchmark_print_time()
This commit is contained in:
parent
3a4ec8d21e
commit
568cbc0cde
@ -26,7 +26,7 @@
|
||||
void benchmark_print_time(uint32_t time, unsigned long runs, const char *name)
|
||||
{
|
||||
uint32_t full = (time / runs);
|
||||
uint32_t div = (time - (full * runs)) * 1000 / runs;
|
||||
uint32_t div = (uint32_t)(((uint64_t)(time - (full * runs))) * 1000 / runs);
|
||||
|
||||
uint32_t per_sec = (uint32_t)(((uint64_t)US_PER_SEC * runs) / time);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user