home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move config defaults from global into main
[khatus.git]
/
x5
/
khatus_lib_time.c
diff --git
a/x5/khatus_lib_time.c
b/x5/khatus_lib_time.c
index
ba74226
..
d13f689
100644
(file)
--- a/
x5/khatus_lib_time.c
+++ b/
x5/khatus_lib_time.c
@@
-1,12
+1,27
@@
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "khatus_lib_log.h"
#include "khatus_lib_time.h"
#include <string.h>
#include <time.h>
#include "khatus_lib_log.h"
#include "khatus_lib_time.h"
+struct timespec
+timespec_of_float(double n)
+{
+ double integral;
+ double fractional;
+ struct timespec t;
+
+ fractional = modf(n, &integral);
+ t.tv_sec = (int) integral;
+ t.tv_nsec = (int) (1E9 * fractional);
+
+ return t;
+}
+
void
snooze(struct timespec *t)
{
void
snooze(struct timespec *t)
{
This page took
0.025484 seconds
and
4
git commands to generate.