This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgHello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4060 to look at the new patch set (#2). Add time conversion helpers Add macros to break down absolute time in seconds into days/hours/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf --- M include/osmocom/core/timer.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/4060/2 diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 40b39b9..4958efb 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -45,6 +45,11 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxrbtree.h> +/* convert absolute time (in seconds) to elapsed days/hours/minutes */ +#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60) +#define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60)) +#define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24)) /* we ignore leap year for simplicity */ + /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>