Пример #1
0
 public static void PreProcessing(bool startStopwatch = false, bool showSize = true)
 {
     dirSizePre = 0;
     dirSizePre = IOUtils.GetDirSize(new DirectoryInfo(currentDir));
     if (showSize)
     {
         Print("\nFolder size before processing: " + Format.Bytes(dirSizePre) + "\n");
     }
     timer.Reset();
     if (startStopwatch)
     {
         timer.Start();
     }
 }
Пример #2
0
 public static void PostProcessing(bool showStopwatch = false, bool showSize = true)
 {
     timer.Stop();
     dirSizeAfter = 0;
     dirSizeAfter = IOUtils.GetDirSize(new DirectoryInfo(currentDir));
     if (showStopwatch)
     {
         Print("Processing time: " + Format.TimeSw(timer));
     }
     if (showSize)
     {
         Print("\nFolder size after processing: " + Format.Bytes(dirSizeAfter) + " from " + Format.Bytes(dirSizePre));
         Print("Size ratio: " + Format.Ratio(dirSizePre, dirSizeAfter) + " of original size");
     }
     progBar.Value = 0;
     Print("Done.");
 }
Пример #3
0
        public static void PostProcessing(int amount, bool showStopwatch = false, bool showSize = true)
        {
            timer.Stop();
            dirSizeAfter = 0;
            dirSizeAfter = IOUtils.GetDirSize(new DirectoryInfo(currentDir));

            progBar.Value = 0;
            Logger.Log("\nDone.");

            if (showStopwatch)
            {
                string rate = ((float)amount / (timer.ElapsedMilliseconds / 1000f)).ToString("0.00");
                Logger.Log($"Processing time: {FormatUtils.TimeSw(timer)} for {amount} files ({rate}/Sec)");
            }


            if (showSize)
            {
                Logger.Log("Folder size after processing: " + FormatUtils.Bytes(dirSizeAfter) + " from " + FormatUtils.Bytes(dirSizePre));
                Logger.Log("Size ratio: " + FormatUtils.Ratio(dirSizePre, dirSizeAfter) + " of original size");
            }
        }