diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-10-19 15:16:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-10-19 17:56:49 -0700 |
| commit | 4e668fdd5b5da0d46f97d835249dbe5f0ea319a7 (patch) | |
| tree | 0aaad8a672024b3a510763150b167320be6f1f5b /tests/stubs.h | |
| parent | d7e39a2423212a31c5ef62dcb0b7a5b4bf9f34df (diff) | |
| download | nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.gz nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.bz2 nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.zip | |
fixes #84 Consider using msec for durations
There is now a public nng_duration type. We have also updated the
zerotier work to work with the signed int64_t's that the latst ZeroTier
dev branch is using.
Diffstat (limited to 'tests/stubs.h')
| -rw-r--r-- | tests/stubs.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/stubs.h b/tests/stubs.h index c77b8db6..780ac772 100644 --- a/tests/stubs.h +++ b/tests/stubs.h @@ -10,12 +10,12 @@ #ifndef STUBS_H #define STUBS_H -#include <stdint.h> -#ifdef _WIN32 +#ifdef _WIN32 #include <windows.h> #else -#include <time.h> +#include <stdint.h> #include <sys/time.h> +#include <time.h> #endif // Stub handlers for some common things. @@ -23,10 +23,10 @@ uint64_t getms(void) { -#ifdef _WIN32 - return (GetTickCount64()) ; +#ifdef _WIN32 + return (GetTickCount64()); #else - static time_t epoch; + static time_t epoch; struct timeval tv; if (epoch == 0) { @@ -40,8 +40,8 @@ getms(void) return (0); } tv.tv_sec -= epoch; - return (((uint64_t)(tv.tv_sec ) * 1000) + (tv.tv_usec / 1000)); + return (((uint64_t)(tv.tv_sec) * 1000) + (tv.tv_usec / 1000)); #endif } -#endif // STUBS_H
\ No newline at end of file +#endif // STUBS_H |
