time execution

Questions about MultiCharts and user contributed studies.
turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

time execution

Postby turbofib » 23 Apr 2020

hi, it's possible to to measure code execution time?
what word reserved i can to use?

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: time execution

Postby Svetlana MultiCharts » 01 May 2020

Hello turbofib,

There is no such pre-built keyword, but you can code it, for example:

Code: Select all

once cleardebug; Var: start_time(time_s); var: end_time(time_s); var: head(1); var: res_time(time_s); once start_time = computerdatetime; var: ii(0); var: xx(0); for ii = 0 to 1000 begin for xx = 0 to 10000 begin head = close + close + ii + xx; end; end; if LastBarOnChart_s then begin once begin end_time = computerdatetime; res_time = end_time - start_time; print(timetostring_ms(res_time)); end; end;


Return to “MultiCharts”