Make CopySingle progress indicator only update every 2 seconds.

This commit is contained in:
TomAwezome 2022-10-24 02:05:24 -04:00
parent 5a8a1ab528
commit ce6c9c29ad

View file

@ -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
{