summaryrefslogtreecommitdiffstats
path: root/src/plugins/tsdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tsdb.c')
-rw-r--r--src/plugins/tsdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/tsdb.c b/src/plugins/tsdb.c
index f7a8ee2..e393109 100644
--- a/src/plugins/tsdb.c
+++ b/src/plugins/tsdb.c
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+#include <time.h>
#include "tsdb.h"
int influxdb_ping()
@@ -41,3 +42,11 @@ int db_ping()
return ret;
}
+
+u_int64_t get_ts()
+{
+ struct timespec ts;
+ clock_gettime(CLOCK_REALTIME, &ts);
+
+ return (int64_t)(ts.tv_sec) * (int64_t)1000000000 + (int64_t)(ts.tv_nsec);
+}