diff --git a/src/Cron.c b/src/Cron.c index cdcfc74..dd820ba 100644 --- a/src/Cron.c +++ b/src/Cron.c @@ -85,7 +85,7 @@ CronThread(void *args) pthread_mutex_lock(&cron->lock); - ts = UtilServerTs(); + ts = UtilTsMillis(); for (i = 0; i < ArraySize(cron->jobs); i++) { @@ -103,7 +103,7 @@ CronThread(void *args) Free(job); } } - te = UtilServerTs(); + te = UtilTsMillis(); pthread_mutex_unlock(&cron->lock); diff --git a/src/Db.c b/src/Db.c index 2a3771c..7aa8490 100644 --- a/src/Db.c +++ b/src/Db.c @@ -587,7 +587,7 @@ DbLockFromArr(Db * db, Array * args) if (db->cache) { - ref->ts = UtilServerTs(); + ref->ts = UtilTsMillis(); ref->size = DbComputeSize(ref->json); HashMapSet(db->cache, hash, ref); db->cacheSize += ref->size; diff --git a/src/HttpServer.c b/src/HttpServer.c index ed8c3a9..14721af 100644 --- a/src/HttpServer.c +++ b/src/HttpServer.c @@ -488,7 +488,7 @@ HttpServerWorkerThread(void *args) * TODO: Instead of looping, abort immediately, and place the request * at the end of the queue. */ - firstRead = UtilServerTs(); + firstRead = UtilTsMillis(); while ((lineLen = UtilGetLine(&line, &lineSize, fp)) == -1 && errno == EAGAIN) { @@ -496,7 +496,7 @@ HttpServerWorkerThread(void *args) // If the server is stopped, or it's been a while, just // give up so we aren't wasting a thread on this client. - if (server->stop || (UtilServerTs() - firstRead) > (1000 * 30)) + if (server->stop || (UtilTsMillis() - firstRead) > (1000 * 30)) { goto finish; } diff --git a/src/Rand.c b/src/Rand.c index b4a61f4..3ece67a 100644 --- a/src/Rand.c +++ b/src/Rand.c @@ -141,7 +141,7 @@ RandIntN(uint32_t *buf, size_t size, uint32_t max) if (!state) { /* Generate a seed from the system time, PID, and TID */ - uint64_t ts = UtilServerTs(); + uint64_t ts = UtilTsMillis(); uint32_t seed = ts ^ getpid() ^ (unsigned long) pthread_self(); state = Malloc(sizeof(RandState)); diff --git a/src/Util.c b/src/Util.c index 403e5ff..6701eb7 100644 --- a/src/Util.c +++ b/src/Util.c @@ -49,7 +49,7 @@ #endif uint64_t -UtilServerTs(void) +UtilTsMillis(void) { struct timeval tv; diff --git a/src/include/Util.h b/src/include/Util.h index d65c37e..feafcff 100644 --- a/src/include/Util.h +++ b/src/include/Util.h @@ -60,7 +60,7 @@ * overflow before it even gets to this function, which will cause this * function to produce unexpected results. */ -extern uint64_t UtilServerTs(void); +extern uint64_t UtilTsMillis(void); /** * Use