You can't do it in exactly 10 seconds. Apart from your considerations you also have to take into account the process scheduler, context switches and the time other processes are running on your "10" seconds.
This is pretty difficult to achieve and you couldn't do it even on multiple core processors.
Maybe on a real-time OS you could find the support to do it.
But, with the common, desktop OS's , something AROUND 10 seconds should be enough.
So, if you are confident that additional computations don't take more than 1 sec at each step, then in an asymptotic analysis they could be ignored.
Otherwise you can do an analysis of you algorithm and derive the average time it takes to run.
Thank you. How can I finish it in 10 seconds but not too early? Please give me your solution.
Bookmarks