X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=time.c;h=0ad974bcac6c8fdf31363e2ad95e4c270e4a5d97;hp=18366cd886946fd5433f6f0bfec3c486a8ffb8b4;hb=fd7ab0475e24ec414883bf3772db160869ed2e0c;hpb=a0b87ba0529cc6ab075e1d7a11f8b4adc47948eb diff --git a/time.c b/time.c index 18366cd..0ad974b 100644 --- a/time.c +++ b/time.c @@ -1,15 +1,22 @@ -#include -#include -#include - /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file time.c Helper functions for dealing with time values. */ +#include +#include +#include +#include +#include + +#include "gcc-compat.h" +#include "error.h" +#include "string.h" +#include "log.h" + /** * Convert struct timeval to milliseconds. * @@ -129,3 +136,11 @@ void tv_divide(const unsigned long divisor, const struct timeval *tv, result->tv_sec = x / 1000 / 1000; result->tv_usec = x % (1000 * 1000); } + +int64_t get_current_time(void) +{ + time_t now; + time(&now); + DSS_DEBUG_LOG("now: %jd\n", (intmax_t)now); + return (int64_t)now; +}