Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_time.h File Reference

Timing utilities. More...

#include "n_common.h"
#include <time.h>
#include <limits.h>
#include "nilorea/n_windows.h"
#include <sys/time.h>
Include dependency graph for n_time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  N_TIME
 Timing Structure. More...

Macros

#define N_TIME_HTTP_DATE_LEN   30
 buffer size for n_time_http_date(): "Thu, 01 Jan 1970 00:00:00 GMT" + NUL
#define N_TIME_RFC2822_LEN   32
 buffer size for n_time_rfc2822(): "Thu, 01 Jan 1970 00:00:00 +0000" + NUL
#define N_TIME_RFC3339_LEN   26
 buffer size for n_time_rfc3339(): "1970-01-01T00:00:00+00:00" + NUL

Functions

time_t get_msec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning msec.
time_t get_sec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning sec.
time_t get_usec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning usec.
int n_time_http_date (time_t t, char *out, size_t size)
 format t as an HTTP date (RFC 9110 IMF-fixdate, always GMT)
int n_time_parse_http_date (const char *s, size_t len, time_t *t)
 parse an HTTP date in IMF-fixdate form ("Sun, 06 Nov 1994 08:49:37 GMT")
int n_time_parse_rfc3339 (const char *s, size_t len, time_t *t)
 parse "YYYY-MM-DD[T| ]HH:MM:SS[Z|+hh:mm|-hh:mm]"
int n_time_rfc2822 (time_t t, long offset, char *out, size_t size)
 format t as an RFC 2822 date with a numeric offset, as RSS wants
int n_time_rfc3339 (time_t t, long offset, char *out, size_t size)
 format t as RFC 3339 / ISO 8601 with a numeric offset
void PAUSE (void)
 for the 'press a key to continue'
int start_HiTimer (N_TIME *timer)
 Init or restart from zero any N_TIME HiTimer.
void u_sleep (unsigned int usec)
 sleep for the given number of microseconds

Detailed Description

Timing utilities.

Author
Castagnier Mickael
Version
1.0
Date
24/03/05

Definition in file n_time.h.