ze-filter  (ze-filter-0.8.0-develop-180218)
zeTime.c
Go to the documentation of this file.
1 /*
2  *
3  * ze-filter - Mail Server Filter for sendmail
4  *
5  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
6  *
7  * Auteur : Jose Marcio Martins da Cruz
8  * jose.marcio.mc@gmail.org
9  *
10  * Historique :
11  * Creation : Wed May 11 13:06:37 CEST 2005
12  *
13  * This program is free software, but with restricted license :
14  *
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * More details about ze-filter license can be found at ze-filter
21  * web site : http://foss.jose-marcio.org
22  */
23 
24 
25 #include <ze-sys.h>
26 #include <libze.h>
27 #include <zeTime.h>
28 
29 /* ****************************************************************************
30  * *
31  * *
32  **************************************************************************** */
33 uint64_t
35 {
36 #if HAVE_GETHRTIME
37  return (uint64_t) (gethrtime() / 1000000);
38 #else
39  struct timeval tv;
40 
41  if (gettimeofday(&tv, NULL) != 0)
42  return 0;
43  return (uint64_t) (tv.tv_sec * 1000 + tv.tv_usec / 1000);
44 #endif
45 }
46 
47 /* ****************************************************************************
48  * *
49  * *
50  **************************************************************************** */
51 time_t
53  time_t ms;
54 {
55  struct timeval tv;
56 
57  tv.tv_sec = 0;
58  tv.tv_usec = ms * 1000;
59  select(0, NULL, NULL, NULL, &tv);
60 
61  return 0;
62 }
uint64_t zeTime_ms()
Definition: zeTime.c:34
time_t zeSleep_ms(time_t ms)
Definition: zeTime.c:52