Message Boards Message Boards

Measuring running time for my program

Posted 1 year ago

Hello, I have two equivalent programs, one in mathematica and one in MATLAB and wanted to compare them with eachother. I wanted to do this be looking at there run times in diffrent scenarios. I've found this to be very easy in MATLAB, just by implementing tictoc but I am struggling to find an equivalent in Mathematica. I have tried using AbsoluteTiming but I haven't been able to encompas the whole code only one line. I think I may be doing something wrong. Kind regards.

2 Replies
Posted 1 year ago

Depends on what you mean by "whole code". Maybe you can provide some sample code so we understand the problem. But if you do need to "roll your own" timer rather than use AbsoluteTiming, you can capture AbsoluteTime before and after and subtract.

POSTED BY: Eric Rimbey

AbsoluteTime works great!!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract