I have runed a code 2 hours ago in Matlab, and it is still running. Is there any way that determine how much more time needed for running to be complete? Is there any time calculator which shows how much time have left?
Asked
Active
Viewed 22 times
0
-
1Hypothetically yes. You would have to determine the run-time complexity of your algorithm. However, the actual run time of your algorithm depends on the language, the optimizations, the architecture you're using and simply the technique you're using. So theoretically yes - practically, no. The best thing you can do is profile your code and determine where in your code is taking the longest, then optimize those portions so that it can be faster so you're not waiting for a long time. I'd also put in debug statements every so often so you can determine where you are currently in your code. – rayryeng Nov 12 '16 at 20:19
-
So, you mean there is not some where which could give me the rest time needed for running, yes? – Nov 12 '16 at 20:26
-
Yes that's exactly what I'm saying. If you want to do that, you'd have to manually put in checkpoints in your code and print those out on your screen. This would give you an **approximate** time for ending. Because your code is already running, there's nothing you can do other than cancelling your code or waiting for it to finish. – rayryeng Nov 12 '16 at 20:27
-
It is so bad :( because it waste my time – Nov 12 '16 at 20:28
-
Sorry :( You're out of luck here. – rayryeng Nov 12 '16 at 20:33
-
Maybe [progressbar](https://www.mathworks.com/matlabcentral/fileexchange/6922-progressbar) will help you. Though as already mentioned, you can never get the exact time remaining. – Autonomous Nov 12 '16 at 21:14