-
-
Notifications
You must be signed in to change notification settings - Fork 309
/
test_tools.c
36 lines (30 loc) · 1.14 KB
/
test_tools.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*****************************************************************************
*
* MODULE: Grass raster3d Library
* AUTHOR(S): Soeren Gebbert, Braunschweig (GER) Jun 2011
* soerengebbert <at> googlemail <dot> com
*
* PURPOSE: Unit and Integration tests
*
* COPYRIGHT: (C) 2000 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "test_raster3d_lib.h"
/* *************************************************************** */
/* Compute the difference between two time steps ***************** */
/* *************************************************************** */
double compute_time_difference(struct timeval start, struct timeval end) {
int sec;
int usec;
sec = end.tv_sec - start.tv_sec;
usec = end.tv_usec - start.tv_usec;
return (double) sec + (double) usec / 1000000;
}