To simulate progress bar in Linux system, you need to know some simple basic knowledge first:
1. In Linux system, it is a carriage return character and a line break character. Carriage return means that the cursor returns to the starting position of the line, and line break means that it jumps to the next line, but the cursor position does not change;
2. The input and output of C \ C + + all have buffers, which are line buffers, line refreshes, and flushes to I \ O area through carriage return;
3. One second = the third power of 1 * 10 milliseconds = the sixth power of 1 * 10 microseconds
C code implementation under Linux:
Code run result:
Thank you for reading, hope to help you, thank you for your support!