I need your help on to calculating the time for copying a file(s) from PC to USB in C#.
Please help.
Thanks in advance.
I need your help on to calculating the time for copying a file(s) from PC to USB in C#.
Please help.
Thanks in advance.
You can't really do that unless you are in the process of sending the file. The best you can do is make estimates on each side of the process.
When you begin to sending/receive, store the time. As you send/receive each group of bytes, you take note of the elapsed time (the current time minus the start time). Divide that by the number of bytes sent/received to determine how long it takes to send one byte. Then, multiply that ratio by the number of bytes left, and you will have the approximate time left to perform the transfer.