libtthimage/Lib/functions.c

28 lines
625 B
C
Raw Permalink Normal View History

2024-08-15 21:08:37 +11:00
/*
* miscellaneous functions
* -----------------------
*
* new: Thu Aug 15 09:55:36 UTC 2024
*
*/
#include <stdio.h>
#include <sys/time.h>
#include "../tthimage.h"
/* ------------------------------------------------------------------- */
/*
* for what FSCKING reason, this func is not in the stdlib ???
*/
double tthi_dtime(void)
{
struct timeval t;
double d;
(void)gettimeofday(&t, NULL);
d = (double)t.tv_sec + (double)t.tv_usec / 1e6;
return d;
}
/* ------------------------------------------------------------------- */
/* ------------------------------------------------------------------- */