HP PRIME - How to convert TICKS in hours, minutes, seconds - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: HP PRIME - How to convert TICKS in hours, minutes, seconds (/thread-255399.html) HP PRIME - How to convert TICKS in hours, minutes, seconds - giancarlo - 11-10-2013 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 Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Gilles Carpentier - 11-10-2013 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 Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - giancarlo - 11-10-2013 Hello Gilles, Do you know if there is any relationship between TICKS and TIME? Tres cordialement Giancarlo Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Harold A Climer - 11-10-2013 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 → Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - giancarlo - 11-10-2013 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 Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Paul Berger (Canada) - 11-10-2013 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. Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Tim Wessman - 11-10-2013 TICKS is in ms and represnts the time since the OS came up. TIME is your user settable time value. Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - cyrille de BrĂ©bisson - 11-12-2013 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 Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Paul Berger (Canada) - 11-12-2013 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. Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Harold A Climer - 11-12-2013 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. Re: HP PRIME - How to convert TICKS in hours, minutes, seconds - Joe Horn - 11-12-2013 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.