Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm learning about thread. I have a trouble:

Process 1 -> makes this command with time 1
Process 2 -> makes this command with time 2
Process 3 -> makes this command with time 3

My trouble is:
Can i have a code in order to guess the summary time of that processes?

if "Process1_time" < "Process2_time < "Process3_time", i will make Process 1 first. Then Process 2. Process 3 is third.

i need your answer!
Thanks!
Posted

1 solution

The time of processing is not exactly predictable; it has a big amount of randomness. You can collect some statistics and find out average time for processing of each fragment of code and, based on that and also on the parameters (number of repeated calls and the like), predict the time of execution, but… 1) the accuracy will be quite low; 2) even the average actual execution time will change depending on many subtle factors, such a operational environment; first of all, the set of other applications running in parallel, phases of their execution, the use of resources; 3) this time may change even more dramatically if the application is executed on some other system; 4) and, finally, this time will change enormously if run on newer systems, with new hardware which will come in near future.

Overall, this exercise will have very little practical sense. At the same time, its very useful to develop a sense of execution time, as the part of the intuition of a software developer. Not an easy skill, by the way. :-)

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900