fsck.f2fs: show elapsed time of full scan
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 21 May 2019 20:17:24 +0000 (13:17 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 20 Aug 2019 18:23:51 +0000 (11:23 -0700)
This patch introduces the elapsed time of fsck.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/main.c

index d844820..9aca024 100644 (file)
@@ -18,6 +18,7 @@
 #include "fsck.h"
 #include <libgen.h>
 #include <ctype.h>
+#include <time.h>
 #include <getopt.h>
 #include "quotaio.h"
 
@@ -745,6 +746,7 @@ int main(int argc, char **argv)
 {
        struct f2fs_sb_info *sbi;
        int ret = 0;
+       clock_t start = clock();
 
        f2fs_init_configuration();
 
@@ -853,7 +855,7 @@ retry:
        if (ret < 0)
                return ret;
 
-       printf("\nDone.\n");
+       printf("\nDone: %lf secs\n", (clock() - start) / (double)CLOCKS_PER_SEC);
        return 0;
 
 out_err: