diff options
Diffstat (limited to 'LuaSL/src/LuaSL_utilities.c')
-rw-r--r-- | LuaSL/src/LuaSL_utilities.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/LuaSL/src/LuaSL_utilities.c b/LuaSL/src/LuaSL_utilities.c index 6a111a2..d73c06d 100644 --- a/LuaSL/src/LuaSL_utilities.c +++ b/LuaSL/src/LuaSL_utilities.c | |||
@@ -61,7 +61,7 @@ char *getDateTime(struct tm **nowOut, char *dateOut, time_t *timeOut) | |||
61 | if (timeOut) | 61 | if (timeOut) |
62 | *timeOut = szClock; | 62 | *timeOut = szClock; |
63 | 63 | ||
64 | // format | 64 | // format |
65 | strftime(date, DATE_TIME_LEN, "%d/%m/%Y %H:%M:%S\r", newTime); | 65 | strftime(date, DATE_TIME_LEN, "%d/%m/%Y %H:%M:%S\r", newTime); |
66 | return (dateTime); | 66 | return (dateTime); |
67 | } | 67 | } |
@@ -73,9 +73,6 @@ float timeDiff(struct timeval *now, struct timeval *then) | |||
73 | struct timeval thisTime = { 0, 0 }; | 73 | struct timeval thisTime = { 0, 0 }; |
74 | double result = 0.0; | 74 | double result = 0.0; |
75 | 75 | ||
76 | //fprintf(stderr, " %ld . %ld\n", now->tv_sec, now->tv_usec); | ||
77 | //fprintf(stderr, "minus %ld . %ld\n", then->tv_sec, then->tv_usec); | ||
78 | |||
79 | thisTime.tv_sec = now->tv_sec; | 76 | thisTime.tv_sec = now->tv_sec; |
80 | thisTime.tv_usec = now->tv_usec; | 77 | thisTime.tv_usec = now->tv_usec; |
81 | if (thisTime.tv_usec < then->tv_usec) | 78 | if (thisTime.tv_usec < then->tv_usec) |
@@ -87,11 +84,8 @@ float timeDiff(struct timeval *now, struct timeval *then) | |||
87 | thisTime.tv_sec -= then->tv_sec; | 84 | thisTime.tv_sec -= then->tv_sec; |
88 | result = ((double) thisTime.tv_usec) / ((double) 1000000.0); | 85 | result = ((double) thisTime.tv_usec) / ((double) 1000000.0); |
89 | result += thisTime.tv_sec; | 86 | result += thisTime.tv_sec; |
90 | //fprintf(stderr, "equals %lf\n", result); | ||
91 | //fflush(stderr); | ||
92 | return result; | 87 | return result; |
93 | } | 88 | } |
94 | else | 89 | else |
95 | return 0.0; | 90 | return 0.0; |
96 | } | 91 | } |
97 | |||