HP PRIME - How to convert TICKS in hours, minutes, seconds



#8

Hello,
most of my programs in my previous calc (Hp49gII) where related to time functions. I would like to recreate some of these programs on my Prime.

Do you know how to convert these TICKS() in hours, minutes and seconds?

thanks

Giancarlo
from the Cappuccino state


#9

By te way you can use TIME instead of TICKS then :

->HMS(TIME)

Edit : Not documented as far I know,but it seems one TICK is exactly 1/1000 sec so

T1:=TICKS;
....
T2:=TICKS;
(T2-T1)/1000 returns the number of seconds between 2 TICKS
so
->HMS((T2-T1)/ 3.6E6)) returns the time between 2 'ticks' in hours minutes seconds format

Edited: 10 Nov 2013, 4:25 a.m. after one or more responses were posted


#10

Hello Gilles,
Do you know if there is any relationship between TICKS and TIME?

Tres cordialement

Giancarlo


#11

TICKS is in ms and represnts the time since the OS came up.

TIME is your user settable time value.

#12

Quote:
Hello,
most of my programs in my previous calc (Hp49gII) where related to time functions. I would like to recreate some of these programs on my Prime.

Do you know how to convert these TICKS() in hours, minutes and seconds?

thanks

Giancarlo
from the Cappuccino state


Tim from HP wrote the following when I asked if the New Prime had a stopwatch function.
Very simple and very preliminary but be useful in answering your question.

EXPORT STOPWATCH()
BEGIN

rect(); //clear screen

local start:=ticks,count:=0; //make some locals

while getkey()==-1 do //while no key is pressed
textout_p(→HMS((ticks-start)/1000),40,40,7,RGB(0,0,125),100,RGB(255,255,255));
textout_p(count:=count+1,0,0,2,RGB(150,0,0),100,RGB(255,255,255));
end;

expr(string((ticks-start)/1000)+"_s"); //make a nice result
end;


END;

Note: In forum message listing the arrow before HMS((ticks-
is replaced by &#8594


#13

Hello Harold,
yes the output of the program is very nice.
i lost this thread in the past.

Do you know if the is a DATE command?

Thanks

Giancarlo


#14

I just tried 'Date' on the home screen of the emulator and it returned 2013.111 which would seem to be Year.MonthDay but the final 0 of the day is dropped. Similarly Time return the time in degrees minutes and seconds...

When I change the display format to fixed 4 the final 0 is displayed and Date returns 2013.1110

Hmmm interesting 'time' and 'Time' return different values the all lower case returns 0.0000 like it may be used to time a function.
time(SLOPE(x^2-5.0000,2.0000)) returns .00008120

These functions are all documented in Help however you will not find the lower case format of 'time' by searching it will always find 'Time' The 'time' is found under Program Catalog->Commands Menu->Other where it is listed as 'TIME' which is obviously incorrect it needs to be 'time' all lower case 'TIME'='Time'

In CAS mode it appears Time return a decimal time rather than in DMS

Edited: 10 Nov 2013, 10:58 a.m.

#15

Hello,

try doing TIME(expression) to time your expression evaluation (note that this expression can be a program call...

Here is your pre-made stop watch!

cyrille


#16

hmmm TIME(SLOPE(x^2-5,2)) returns 0_s time(SLOPE(x^2-5,2)) returns .00009000. TIME by itself returns the time of day as does Time.


#17

Quote:
hmmm TIME(SLOPE(x^2-5,2)) returns 0_s time(SLOPE(x^2-5,2)) returns .00009000. TIME by itself returns the time of day as does Time.

When timing events with TIME(), only do it in Home, not CAS. It currently always returns 0_s in CAS... a known bug.

TIME(wait(2) in Home --> 2_s

TIME(wait(2) in CAS --> 0_s (bug)

The time() function works in both Home and CAS, but doesn't include the seconds unit.

#18

Quote:
Hello,

try doing TIME(expression) to time your expression evaluation (note that this expression can be a program call...

Here is your pre-made stop watch!

cyrille


I was thinking that since the Prime is education oriented and that it will be able to connect to the StreamSmart,it would be nice to have a Stopwatch App as one of the built in Apps.
This was why I asked Tim the question in the first place.
Students could use the Prime as a stopwatch for various Physics,Chemistry ,etc labs without having to write a program.
It would need to be similar to a stopwatch program recently uploaded to Eric's Web Site,for the 50G.

Possibly Related Threads…
Thread Author Replies Views Last Post
  PRIME: 5 minutes' use, now $115 Peter Murphy (Livermore) 3 1,559 10-27-2013, 10:49 PM
Last Post: Michael de Estrada
  HP 50g Takes hours to compute a convergent series Matthew Richards 10 3,198 05-14-2013, 03:30 PM
Last Post: Thomas Klemm
  DM15CC - only a few hours left. Harald 2 1,268 05-31-2012, 11:27 PM
Last Post: Reth
  new convert? db (martinez, ca.) 11 2,909 02-01-2012, 10:55 PM
Last Post: Palmer O. Hanson, Jr.
  33S times off in 4 seconds designnut 4 1,579 09-18-2011, 12:55 PM
Last Post: Frank Rottgardt
  wp34S TICKS Command: How Much Time? Jake Schwartz 5 1,735 07-13-2011, 01:59 PM
Last Post: Walter B
  So leaving the board in one piece takes 5 minutes? Egan Ford 10 2,639 10-07-2010, 04:01 PM
Last Post: BruceH
  Plug for the MoHPC forum: 72 hours in a day DaveJ 10 2,726 04-30-2009, 06:13 PM
Last Post: DaveJ
  Can we beat the 5.81 hours on the TI95 with the HP71B? Gene, Yes we can! Egan Ford 12 3,332 03-02-2009, 04:41 PM
Last Post: Egan Ford
  Calc Benchmark - HP41 MCODE - 11.05 seconds PeterP 7 2,325 02-18-2009, 10:23 AM
Last Post: PeterP

Forum Jump: