Which code is faster?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #131502 quote
    smhhadima
    Participant
    Junior

    will this code execute faster than the below code?

    //Code 1
    temp1=(close>open)
    if(temp1) then
     .....
    endif
    
    temp1=(close>10) //I will reuse the same temporary variable again
    if(temp1) then
     .....
    endif
      or this code will be faster?
    //Code 1
    temp1=(close>open)
    if(temp1) then
     .....
    endif
    
    temp2=(close>10) //I will another temporary variable
    if(temp2) then
     .....
    endif
    #131504 quote
    robertogozzi
    Moderator
    Master
    It’s the same, maybe the second one might spare some RAM, but speed won’t be affected. This link might be of some interest https://www.prorealcode.com/blog/learning/speed-calculation-indicator/.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Which code is faster?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
smhhadima @smhhadima Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
5 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/13/2020
Status: Active
Attachments: No files
Logo Logo
Loading...