@@ -166,6 +166,7 @@ int ethsock_ip_add(struct ethsock *sock, uint32_t ipaddr, uint32_t ipmask, struc
int ethsock_ip_del(struct ethsock *sock, struct ethsock_ip_undo **undo);
time_t time_monotonic();
+long long millis();
char *lltostr(long long ll, int base);
uint32_t bitcount(uint32_t n);
uint32_t netmask(uint32_t count);
@@ -30,15 +30,21 @@
volatile sig_atomic_t g_interrupted = 0;
int verbosity = 0;
-time_t time_monotonic()
+long long millis()
{
#ifndef NMRPFLASH_WINDOWS
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- return ts.tv_sec;
+ return ts.tv_sec * 1000 + ((ts.tv_nsec + 500000) / 1000000);
#else
- return round(GetTickCount() / 1000.0);
+ return GetTickCount();
#endif
+
+}
+time_t time_monotonic()
+{
+ return millis() / 1000;
}
char *lltostr(long long ll, int base)