Optimizing Execution Time for Linear Code in Mathematica with a P4 Processor

  • Context: Mathematica 
  • Thread starter Thread starter Amar.alchemy
  • Start date Start date
  • Tags Tags
    Mathematica Time
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 3K views
Amar.alchemy
Messages
78
Reaction score
0
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]
 
on Phys.org
Amar.alchemy said:
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]


I think we can assume this code is linear. So, what you have to do is:
For[i = 1, i <= 10000, i++, If[i == x, Print]]

Where x is (10000/47888755100)*47888755200. Count the time with a function that gives you the time it takes, the time for your computation would be something like t0*47888755200/10000.


Greetz,
Littlepig