#ifndef _TIME_UTIL_H_
#define _TIME_UTIL_H_

/*! \file time_util.h
    \brief Some functions to help with struct timeval */

/*! \brief Substracts two timevals
    \return result = tv2 - tv1
 */
void tval_minus(struct timeval *result,
    struct timeval *tv1, struct timeval *tv2);

/*! \brief Pretty print the timeval */
void tval_print(struct timeval *tv);


#ifdef WINDOWS

/** On Microsoft Windows operating systems, the gettimeofday function is
    usually not available. For this purpose we implement a very simple one,
    which precision is one second. */

/*! \brief A very simple implementation for Microsoft Windows.

    This function is designed for the use in this software only and should not
    be used in general */
int gettimeofday(struct timeval *tp, void *tzp);

#endif

#endif
