From ce6c9c29adb6576848b302870c139c84003653fb Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Mon, 24 Oct 2022 02:05:24 -0400 Subject: [PATCH] Make CopySingle progress indicator only update every 2 seconds. --- src/Kernel/BlkDev/DiskCopy.ZC | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Kernel/BlkDev/DiskCopy.ZC b/src/Kernel/BlkDev/DiskCopy.ZC index 7a991794..fb029da5 100755 --- a/src/Kernel/BlkDev/DiskCopy.ZC +++ b/src/Kernel/BlkDev/DiskCopy.ZC @@ -29,7 +29,7 @@ Bool CopySingleZ(U8 *f1, U8 *f2) //Just one file Bool CopySingle(U8 *f1, U8 *f2) //Just one file { U8 *absf1 = FileNameAbs(f1), *absf2 = FileNameAbs(f2), *buf; - I64 count, n, size, attr1 = FileAttr(f1), attr2 = FileAttr(f2), i, j; + I64 count, n, size, attr1 = FileAttr(f1), attr2 = FileAttr(f2), i, j, time = counts.jiffies; CFile *in_file = NULL, *out_file = NULL; if (!StrCompare(absf1, absf2)) @@ -65,8 +65,11 @@ Bool CopySingle(U8 *f1, U8 *f2) //Just one file { n = COPY_BUF_BLKS; i = n << BLK_SIZE_BITS; - if (size) + if (counts.jiffies > time + 2000) + { "\n [ %0.2f%% ]", 100 * ToF64(size - j) / size; + time = counts.jiffies; + } } else {