Merge branch 'mb/relnotes-2.1'
[gitweb.git] / wt-status.c
index 882cfe9fb050efe84e2330b9aea76685c6a7f891..27da5296be253844e0f2bc8d5996faf343192828 100644 (file)
@@ -574,14 +574,11 @@ static void wt_status_collect_untracked(struct wt_status *s)
 {
        int i;
        struct dir_struct dir;
-       struct timeval t_begin;
+       uint64_t t_begin = getnanotime();
 
        if (!s->show_untracked_files)
                return;
 
-       if (advice_status_u_option)
-               gettimeofday(&t_begin, NULL);
-
        memset(&dir, 0, sizeof(dir));
        if (s->show_untracked_files != SHOW_ALL_UNTRACKED_FILES)
                dir.flags |=
@@ -612,13 +609,8 @@ static void wt_status_collect_untracked(struct wt_status *s)
        free(dir.ignored);
        clear_directory(&dir);
 
-       if (advice_status_u_option) {
-               struct timeval t_end;
-               gettimeofday(&t_end, NULL);
-               s->untracked_in_ms =
-                       (uint64_t)t_end.tv_sec * 1000 + t_end.tv_usec / 1000 -
-                       ((uint64_t)t_begin.tv_sec * 1000 + t_begin.tv_usec / 1000);
-       }
+       if (advice_status_u_option)
+               s->untracked_in_ms = (getnanotime() - t_begin) / 1000000;
 }
 
 void wt_status_collect(struct wt_status *s)