cancel
Showing results for 
Search instead for 
Did you mean: 
JKova
Level 4
140 93 2 5
Message 1 of 8
1,444
Flag Post

Solved!

Is there any way how to measure program execution time in HP 50g graphing calculator ?

HP Recommended
HP 50g

Hello dear HP community , 

I wanna know how to measure program execution time , if you did not understand from tittle ,  I want to know how to measure program execution time when i run some program written in HP 50g graphing calculator !!

 

If is possible to measure what time does it take to measure how fast program "works" from beginning to the end of program .

And also , if you knew that , I wanted to know if is possible to do SPEED MEASUREMENTS  with programs written in User RPL ?

 

Thanks a lot !!

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Joe_Horn
Level 8
650 635 124 222
Message 2 of 8
Flag Post
HP Recommended

Yes: Use the TEVAL command. Its name means "Timed EVAL" (I think). It EVALs the object on level 1, returns its results to the stack as usual, then also pushes the number of seconds which elapsed during that execution, tagged with an "s" to remind you that it's a number of seconds.

 

Examples:

 

<< 1 WAIT >>

TEVAL -->

1: s:1.01 (results will differ slightly)

 

<< 1000 ! >>

TEVAL -->

2: 40238726007709377....... (the value of 1000 factorial)

1: s:28.8 (results will differ slightly)

 

'MYPROG'

TEVAL --> the output(s) of MYPROG, and the number of seconds it took to run.

 

Disclaimer: I don't work for HP, but HP works for me.

-Joe-

View solution in original post

Tags (1)
Was this reply helpful? Yes No
7 REPLIES 7
Joe_Horn
Level 8
650 635 124 222
Message 2 of 8
Flag Post
HP Recommended

Yes: Use the TEVAL command. Its name means "Timed EVAL" (I think). It EVALs the object on level 1, returns its results to the stack as usual, then also pushes the number of seconds which elapsed during that execution, tagged with an "s" to remind you that it's a number of seconds.

 

Examples:

 

<< 1 WAIT >>

TEVAL -->

1: s:1.01 (results will differ slightly)

 

<< 1000 ! >>

TEVAL -->

2: 40238726007709377....... (the value of 1000 factorial)

1: s:28.8 (results will differ slightly)

 

'MYPROG'

TEVAL --> the output(s) of MYPROG, and the number of seconds it took to run.

 

Disclaimer: I don't work for HP, but HP works for me.

-Joe-

View solution in original post

Tags (1)
Was this reply helpful? Yes No
JKova
Author
Level 4
140 93 2 5
Message 3 of 8
Flag Post
HP Recommended

Hi Joe , 

Thanks a lot for a reply to my message !!

But i mean that you make a mistake , or not ... I'm not sure because I solve this task 1000! and I get different numbers from yours . I mean you got 40238726007709377... for solving factorial of 1000 , and I get some sort of infinite numbers .

I did not mentioned that I solve this task in HP 50g emulator , not physically in real HP 50g graphing calculator , so maybe is my result slight different because i used emulator instead of real HP 50g graphing calculator !! 

 

Look at the pictures ...

I used your function << 1000 ! >> TEVAL ...

FIGURE 01 :  I used to type << 1000 ! >> TEVAL like you write in reply messageFIGURE 01 : I used to type << 1000 ! >> TEVAL like you write in reply message

When i hit ENTER , i get this result which is written down below inside picture , look at the picture :Wink:

 

Result and time needed to execute a 1000 factorial program !!Result and time needed to execute a 1000 factorial program !!

Like I said , I really don't know if is result slight different because i used a HP emulator because I don't have HP 50g graphing calculator with me ( physically ) , but that does not matters right now because you helped me with solving task that I request :generic: 

 

Thank you very much Joe Horn :OpenSmile:

You always give me a good advices and answers :Sunglasses:

I'll accept your solution definitely !!!

 

Have a nice day , 

 

Josip Kova 

 

Was this reply helpful? Yes No
Maké
Level 9
3,551 3,458 180 540
Message 4 of 8
Flag Post
HP Recommended

Hi!, @JKova :

The result of 1000! is +infinite in Approximate Mode and the HP50G calculator delay ...

TEVAL.JPG

But, if you comparison with Wlofram Alpha, is ...

TEVAL_1.JPG

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
Was this reply helpful? Yes No
Joe_Horn
Level 8
650 635 124 222
Message 5 of 8
Flag Post
HP Recommended

@JKova wrote:

I'm not sure because I solve this task 1000! and I get different numbers from yours . I mean you got 40238726007709377... for solving factorial of 1000 , and I get some sort of infinite numbers .

Try again with your 59g in EXACT MODE. (Press MODE, CAS, and uncheck Approx). In exact mode, you can input and output "long integers" (also sometimes called "infinite precision integers" although that's obviously an exaggeration).  Long integers can even be used in algebraic expressions, thus allowing exact fractions and exact coefficients.  When you want to return to the normal HP world of real numbers limited to 12-digit mantissas, then turn on approximate mode.

-Joe-
Was this reply helpful? Yes No
JKova
Author
Level 4
140 93 2 5
Message 6 of 8
Flag Post
HP Recommended

Dear Joe ,

Yeah i did not realize that you use Wolfram Alpha to calculate such amount of numbers . sorry about that !! 

Once again , I apologize to you !! 

I almost forget it to tell you that I'm so gratefull to you for your explanation how to use exact mode . I did not tried with exact mode to solve any of tasks but I will in the future , maybe :Sunglasses:

 

Thank you !!

 

Best regards ,

Josip Kova

Was this reply helpful? Yes No
Maké
Level 9
3,551 3,458 180 540
Message 7 of 8
Flag Post
HP Recommended

Hi!, Josip Kova :

I was the one who wrote to you the comparise with Wolfram Alpha, not Joseph Horn.

With HP50G in CAS for Approx. or Exact Mode for infinite is same and only present, in LCD Display ... 9.99999999999E499

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
Was this reply helpful? Yes No
JKova
Author
Level 4
140 93 2 5
Message 8 of 8
Flag Post
HP Recommended

Dear @Maké ,

It seems that I did not read when I was typing :HalfEyes: I'm really , really sorry about that @Maké ... unacceptable I know :HalfEyes:

 

But thank you anyway for your advices , about that number that you get from Wolfram Alpha and others too !! 

Sorry man , I don't know what else to say , now I know too much ( about my request that I asked this community  )  !!

 

Thank you very much !! 

Best regards ,

Josip Kova

 

 

Was this reply helpful? Yes No
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation