Data Structures | |
| struct | switch_time_exp_t |
Typedefs | |
| typedef int64_t | switch_time_t |
| typedef int64_t | switch_interval_time_t |
| typedef switch_time_exp_t | switch_time_exp_t |
Functions | |
| switch_time_t | switch_time_make (switch_time_t sec, int32_t usec) |
| switch_time_t | switch_time_now (void) |
| switch_status_t | switch_time_exp_gmt_get (switch_time_t *result, switch_time_exp_t *input) |
| switch_status_t | switch_strftime (char *s, switch_size_t *retsize, switch_size_t max, const char *format, switch_time_exp_t *tm) |
| switch_status_t | switch_rfc822_date (char *date_str, switch_time_t t) |
| switch_status_t | switch_time_exp_gmt (switch_time_exp_t *result, switch_time_t input) |
| switch_status_t | switch_time_exp_get (switch_time_t *result, switch_time_exp_t *input) |
| switch_status_t | switch_time_exp_lt (switch_time_exp_t *result, switch_time_t input) |
| switch_status_t | switch_time_exp_tz (switch_time_exp_t *result, switch_time_t input, switch_int32_t offs) |
| void | switch_sleep (switch_interval_time_t t) |
|
|
number of microseconds in the interval |
|
|
a structure similar to ANSI struct tm with the following differences:
|
|
|
number of microseconds since 00:00:00 january 1, 1970 UTC |
|
||||||||||||
|
switch_rfc822_date formats dates in the RFC822 format in an efficient manner. It is a fixed length format which requires the indicated amount of storage, including the trailing NUL terminator.
00260 {
00261 return apr_rfc822_date(date_str, t);
00262 }
|
|
|
Sleep for the specified number of micro-seconds.
00140 {
00141
00142 #if defined(HAVE_USLEEP)
00143 usleep(t);
00144 #elif defined(WIN32)
00145 Sleep((DWORD) ((t) / 1000));
00146 #else
00147 apr_sleep(t);
00148 #endif
00149
00150 #if 0
00151 #if defined(HAVE_CLOCK_NANOSLEEP) && defined(SWITCH_USE_CLOCK_FUNCS)
00152 struct timespec ts;
00153 ts.tv_sec = t / APR_USEC_PER_SEC;
00154 ts.tv_nsec = (t % APR_USEC_PER_SEC) * 1000;
00155
00156 clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL);
00157
00158 #elif defined(HAVE_USLEEP)
00159 usleep(t);
00160 #elif defined(WIN32)
00161 Sleep((DWORD) ((t) / 1000));
00162 #else
00163 apr_sleep(t);
00164 #endif
00165 #endif
00166
00167 }
|
|
||||||||||||||||||||||||
|
formats the exploded time according to the format specified
00106 {
00107 return apr_strftime(s, retsize, max, format, (apr_time_exp_t *) tm);
00108 }
|
|
||||||||||||
|
Convert time value from human readable format to a numeric apr_time_t e.g. elapsed usec since epoch
00240 {
00241 return apr_time_exp_get(result, (apr_time_exp_t *) input);
00242 }
|
|
||||||||||||
|
convert a time to its human readable components in GMT timezone
00255 {
00256 return apr_time_exp_gmt((apr_time_exp_t *) result, input);
00257 }
|
|
||||||||||||
|
Convert time value from human readable format to a numeric apr_time_t that always represents GMT
00235 {
00236 return apr_time_exp_gmt_get(result, (apr_time_exp_t *) input);
00237 }
|
|
||||||||||||
|
convert a time to its human readable components in local timezone
00245 {
00246 return apr_time_exp_lt((apr_time_exp_t *) result, input);
00247 }
|
|
||||||||||||||||
|
convert a time to its human readable components in a specific timezone with offset
00250 {
00251 return apr_time_exp_tz((apr_time_exp_t *) result, input, (apr_int32_t )offs);
00252 }
|
|
||||||||||||
|
00265 {
00266 return ((switch_time_t) (sec) * APR_USEC_PER_SEC + (switch_time_t) (usec));
00267 }
|
|
|
00224 {
00225 #if defined(HAVE_CLOCK_GETTIME) && defined(SWITCH_USE_CLOCK_FUNCS)
00226 struct timespec ts;
00227 clock_gettime(CLOCK_REALTIME, &ts);
00228 return ts.tv_sec * APR_USEC_PER_SEC + (ts.tv_nsec / 1000);
00229 #else
00230 return (switch_time_t) apr_time_now();
00231 #endif
00232 }
|
1.3.9.1