projects
/
project
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e78caa
)
odhcdp: use a more suitable clock
author
David Härdeman
<
[email protected]
>
Fri, 10 Oct 2025 20:57:08 +0000
(22:57 +0200)
committer
Álvaro Fernández Rojas
<
[email protected]
>
Tue, 21 Oct 2025 17:01:11 +0000
(19:01 +0200)
In my testing, CLOCK_MONOTONIC_COARSE uses about 1/3 of the CPU cycles.
And the accuracy is completely irrelevant.
Signed-off-by: David Härdeman <
[email protected]
>
Link:
https://github.com/openwrt/odhcpd/pull/282
Signed-off-by: Álvaro Fernández Rojas <
[email protected]
>
src/odhcpd.c
patch
|
blob
|
history
diff --git
a/src/odhcpd.c
b/src/odhcpd.c
index 4b17a161152c6e7f672b9b21bf9e0d4e5a984bd7..ef67acc630a1c142be0b29eab29179dccd3333dd 100644
(file)
--- a/
src/odhcpd.c
+++ b/
src/odhcpd.c
@@
-551,7
+551,7
@@
int odhcpd_urandom(void *data, size_t len)
time_t odhcpd_time(void)
{
struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_MONOTONIC
_COARSE
, &ts);
return ts.tv_sec;
}