c++ - Progress bar for loading file -


Whenever I try to load large files, my program does not show me anything until the file is loaded and Then it prints "successfully loaded", but I want to print out how many percentages are loaded in every 0.500ms (its C ++) how can I get it, how many files do it in the restrictions Is loaded in replacement?

You will get a total byte or line in the file. When calculating the percentage, it will be lower.

If you use the file size, you can calculate the percentage using the file reading position.

The recommended algorithm is to use at least two threads.
A thread is a GUI thread.
The other thread worker will read thread thread in the worker's thread file.

Some people believe that the worker thread should progress in its global progress and the GUI thread should choose that variable.

Others believe that the worker thread should send messages to periodic or other intervals on GUI threads.

The option is yours.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -