Bibliothèque de traitements d'images en virgule flottante.
http://la.buvette.org/photos/cumul/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
866 B
44 lines
866 B
![]()
4 years ago
|
/*
|
||
|
* timers.c
|
||
|
*/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <sys/time.h>
|
||
|
|
||
|
extern int verbosity;
|
||
|
|
||
|
/* ----------------------------------------------------------------- */
|
||
|
static double dtime(void)
|
||
|
{
|
||
|
struct timeval t;
|
||
|
double d;
|
||
|
(void)gettimeofday(&t, NULL);
|
||
|
d = (double)t.tv_sec + (double)t.tv_usec / 1e6;
|
||
|
return d;
|
||
|
}
|
||
|
/* ----------------------------------------------------------------- */
|
||
|
|
||
|
|
||
|
static double memory_time;
|
||
|
|
||
|
double fimg_timer_set(int whot)
|
||
|
{
|
||
|
double current;
|
||
|
|
||
|
current = dtime();
|
||
|
|
||
|
#if DEBUG_LEVEL
|
||
|
fprintf(stderr, "%s ( %d ) -> current %f\n", __func__, whot, current);
|
||
|
#endif
|
||
|
memory_time = current;
|
||
|
return memory_time;
|
||
|
}
|
||
|
/* ----------------------------------------------------------------- */
|
||
|
double fimg_timer_get(int whot)
|
||
|
{
|
||
|
double current;
|
||
|
current = dtime();
|
||
|
return current - memory_time;
|
||
|
}
|
||
|
/* ----------------------------------------------------------------- */
|