mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
[ fix ] Cast CLOCKS_PER_SEC to float before division
The cast to float needs to happen before the division, otherwise integer division will be performed, and as a result `CLOCKS_PER_NSEC` will always be 0 if `CLOCKS_PER_SEC` < `NSEC_PER_SEC`.
This commit is contained in:
parent
2a4197e909
commit
18e15e2261
@ -1,7 +1,7 @@
|
||||
#include "clock.h"
|
||||
|
||||
#define NSEC_PER_SEC 1000000000
|
||||
#define CLOCKS_PER_NSEC ((float)(CLOCKS_PER_SEC / NSEC_PER_SEC))
|
||||
#define CLOCKS_PER_NSEC ((float)CLOCKS_PER_SEC / NSEC_PER_SEC)
|
||||
|
||||
Value *clockTimeMonotonic()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user