MCPcopy Create free account
hub / github.com/ElementsProject/lightning / time_sub_

Function time_sub_

ccan/ccan/time/time.h:313–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313static inline struct timespec time_sub_(struct timespec recent,
314 struct timespec old)
315{
316 struct timespec diff;
317
318 diff.tv_sec = TIME_CHECK(recent).tv_sec - TIME_CHECK(old).tv_sec;
319 if (old.tv_nsec > recent.tv_nsec) {
320 diff.tv_sec--;
321 diff.tv_nsec = 1000000000 + recent.tv_nsec - old.tv_nsec;
322 } else
323 diff.tv_nsec = recent.tv_nsec - old.tv_nsec;
324
325 return TIME_CHECK(diff);
326}
327
328/**
329 * time_sub - subtract two relative times

Callers 4

time_subFunction · 0.85
time_betweenFunction · 0.85
timemono_betweenFunction · 0.85
timeabs_subFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected