How to predict the operating time of a program in C ++ if the program performs different functions (working with a database, reading files, parsing XML, and others)? How do installers do this?
They do not predict time. They count the number of operations that must be performed in total operations.
You can predict time by measuring and evaluating. Of course, the quality of the forecasts will be different. And BTW: The word "predict" is true.
, : 10 , 90 90 . .
.
- , .
:
, . .. , . -:
for(int i=0; i<num_files_to_load; ++i){ files.push_back(File(filepath[i])); SetProgressBarLength((float)i/((float)num_files_to_load) - 1.0f); }
. , , / . , , , - .
N , , , , . . , . - , - . , , , . , .
?- . , . , , , .
?
- . , . , , , .
, . , . .
http://en.wikipedia.org/wiki/Halting_problem
, . , Partial rmn, .
, (, , db , , ).
, op, .
3D- , , , . , . ( 10-15 /, 10-20 )
, , , , , 1%, - , 1% 100, . , , , - .
, .
, ( , , .. ..) + . (, , , ), .
, , , - , , :)
You must make an estimate of the time required for the different stages of the program. For example: reading files - 50, working with a database - 30, working with a network - 20. Ideally, it would be nice if you made some progress callback at all these stages, but it requires encoding the calculation of progress in iterations of the algorithm,
Source: https://habr.com/ru/post/1726361/More articles:Кластер JBoss 5 как долговечная проблема сервера JMS - javaUsing Subquery Results as a Query Variable - tsqlArguments for stateless protocols (context: simple point-to-point communication) - protocolsspring - hibernate * .hbm.xml download from classpath resource - javaXSLT for structure conversion + Ruby for value conversion? - ruby | fooobar.comСохранять локальные данные конфигурации в SharePoint - cachingManaging XML Serialization from a DataSet - Attributes in a TableName Element - datasetTrigger before removing MySql - mysqlHow can I better handle this situation in ASP.NET MVC regarding my Partial Views? - c #Сериализация полей в пользовательском DataSet для XML - c#All Articles