MATLAB: Timing Comet

comettic toc

Can you time the time it takes for comet to complete graphing? tic toc times the time it takes for the code to run but I want to time the time it takes to graph the function.
Any help would be appreciated.

Best Answer

No. Graphics operations are delegated to graphics drivers which can potentially operate independently of MATLAB (different threads, dedicated graphics cards, graphics might be built into the CPU and might or might not steal cycle time from ordinary operations.) When MATLAB regains control, the graphics is not necessarily completed, or it could be an arbitrary time after the graphics completed (e.g. because the operating system decided to take a coffee break while the disk defragments itself.)