58 double fval,begin,span;
62 begin = (double) start;
63 span = (double) (end - start);
67 span = (double) (start - end);
77 s = 16807 * (s - k * 127773) - 2836 * k;
86 fval = (double) s / (
double) 0x7fffffff
L;
88 fval *= (double) span;
89 fval += (double) begin;
114 fp =
fopen(str,
"rb");
116 fp =
fopen(str,
"wb");
119 perror(
"timetest file open failed");
152 fprintf(fp,
"%4d,%2d,%2d, %02d:%02d:%2d\n",
160 fprintf(fp,
"%4d,%2d,%2d, %02d:%02d:%2d\n",
167 fprintf(fp,
"%4d,%2d,%2d, %02d:%02d:%2d\n",
178 perror(
"timetest fclose failed");
MEMSPACE char * asctime_r(tm_t *t, char *buf)
Convert tm_t *t structure into POSIX asctime() ASCII string *buf.
MEMSPACE time_t mktime(tm_t *t)
convert tm_t structure to time_t local time epoch
Master include file for project Includes all project includes and defines here.
Common Linux/POSIX time functions.
MEMSPACE FILE * fopen(const char *path, const char *mode)
POSIX Open a file with path name and ascii file mode string.
MEMSPACE void mysrand(int seed)
MEMSPACE void perror(const char *s)
POSIX perror() - convert POSIX errno to text with user message.
MEMSPACE int fprintf(FILE *fp, const char *format,...)
fprintf function Example user defined printf function using fputc for I/O This method allows I/O to d...
void optimistic_yield(uint32_t interval_us)
uint32_t time_t
type of EPOCH result.
static unsigned int __seed
MEMSPACE int myrand(int start, int end)
Math IO functions, and verious conversion code with floating point support.
MEMSPACE int timetests(char *str, int check)
MEMSPACE int fclose(FILE *stream)
POSIX close a file stream.
MEMSPACE int gettimeofday(tv_t *tv, tz_t *tz)
Get current time struct timeval *tv and struct timezone *tz - POSIX function. We assume a GMT hardwar...
MEMSPACE int printf(const char *format,...)
MEMSPACE tm_t * localtime_r(time_t *t, tm_t *result)
Convert POSIX epoch time_t *tp into POSIX tm_t *result expressed as local time using timezone and DST...
MEMSPACE char * skipspaces(char *ptr)
Skip white space in a string - tabs and spaces.