diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-09-06 09:37:56 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-09-06 09:37:56 +0000 |
| commit | 48e06b650a393ca6fc0b65bd601d67904dd669e8 (patch) | |
| tree | 885b3f61086835949560c9e0c7568c50c4ec6cea /src/libstddjb/tain_now_set_stopwatch.c | |
| parent | 07db6986589d42e2dcb5b1e91c57da9ec990bc4e (diff) | |
| download | skalibs-48e06b650a393ca6fc0b65bd601d67904dd669e8.tar.gz | |
Change tain_now_set_* API: also give an initial value
Diffstat (limited to 'src/libstddjb/tain_now_set_stopwatch.c')
| -rw-r--r-- | src/libstddjb/tain_now_set_stopwatch.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libstddjb/tain_now_set_stopwatch.c b/src/libstddjb/tain_now_set_stopwatch.c index ef869f7..a770141 100644 --- a/src/libstddjb/tain_now_set_stopwatch.c +++ b/src/libstddjb/tain_now_set_stopwatch.c @@ -17,21 +17,24 @@ static tain_t offset ; -static int tain_now_stopwatch (tain_t *a) +static int tain_now_stopwatch (tain_t *now) { - return tain_stopwatch_read(a, SKALIBS_STOPWATCH, &offset) ; + return tain_stopwatch_read(now, SKALIBS_STOPWATCH, &offset) ; } -void tain_now_set_stopwatch (void) +int tain_now_set_stopwatch (tain_t *now) { - if (!tain_stopwatch_init(SKALIBS_STOPWATCH, &offset)) return ; + if (!tain_stopwatch_init(now, SKALIBS_STOPWATCH, &offset)) + return tain_now_set_wallclock(now) ; tain_now = &tain_now_stopwatch ; + return 1 ; } #else -void tain_now_set_stopwatch (void) +int tain_now_set_stopwatch (tain_t *now) { + return tain_now_set_wallclock(now) ; } #endif |
