~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getsystime.c

  • Committer: Monty Taylor
  • Date: 2008-07-15 21:40:58 UTC
  • mfrom: (77.1.113 codestyle32)
  • mto: This revision was merged to the branch mainline in revision 176.
  • Revision ID: mordred@camelot-20080715214058-rm3phulldos9xehv
Merged from codestyle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mysys_priv.h"
26
26
#include "my_static.h"
27
27
 
28
 
#if TIME_WITH_SYS_TIME
29
 
# include <sys/time.h>
30
 
# include <time.h>
31
 
#else
32
 
# if HAVE_SYS_TIME_H
33
 
#  include <sys/time.h>
34
 
# else
35
 
#  include <time.h>
36
 
# endif
37
 
#endif 
38
 
 
39
28
uint64_t my_getsystime()
40
29
{
41
30
#ifdef HAVE_CLOCK_GETTIME
139
128
    Value in microseconds from some undefined point in time
140
129
*/
141
130
 
 
131
#define DELTA_FOR_SECONDS 500000000LL  /* Half a second */
142
132
 
143
133
uint64_t my_micro_time_and_time(time_t *time_arg)
144
134
{
147
137
    Solaris has a very slow time() call. We optimize this by using the very
148
138
    fast gethrtime() call and only calling time() every 1/2 second
149
139
  */
150
 
 
151
 
#define DELTA_FOR_SECONDS 500000000LL  /* Half a second */
152
 
 
153
140
  static hrtime_t prev_gethrtime= 0;
154
141
  static time_t cur_time= 0;
155
142
  hrtime_t cur_gethrtime;