MXS-1446: Add heartbeat conversion macros

The macros make the conversion from heartbeats to seconds more convenient
and consistent.
This commit is contained in:
Markus Mäkelä
2017-09-27 11:15:22 +03:00
parent 667440fbef
commit 0d6c06f33d
5 changed files with 16 additions and 7 deletions

View File

@ -23,4 +23,14 @@ MXS_BEGIN_DECLS
extern int64_t hkheartbeat;
/**
* Convert heartbeats to seconds
*/
#define HB_TO_SEC(a) ((int64_t)a / 10)
/**
* Convert seconds to heartbeats
*/
#define SEC_TO_HB(a) ((int64_t)a * 10)
MXS_END_DECLS