summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 140a354..5165fd6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -457,6 +457,15 @@ time_t dnsmasq_time(void)
#endif
}
+u32 dnsmasq_milliseconds(void)
+{
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+
+ return (tv.tv_sec) * 1000 + (tv.tv_usec / 1000);
+}
+
int netmask_length(struct in_addr mask)
{
int zero_count = 0;