Re: May the numbers speak

Liste des GroupesRevenir à cl forth 
Sujet : Re: May the numbers speak
De : mhx (at) *nospam* iae.nl (mhx)
Groupes : comp.lang.forth
Date : 12. Jun 2025, 09:12:50
Autres entêtes
Organisation : novaBBS
Message-ID : <74f2e030895c9c5dbdf233a8f7489c34@www.novabbs.com>
References : 1 2 3 4
User-Agent : Rocksolid Light
There may be several issues on a real computer which make
these considerations immaterial:
ANEW -timescan
: dtimescan ( addr count -- d )
   over swap + >r >r
   0. r> 0
   begin
      over r@ <
   while
      over c@ ':'
      = if  swap >r s>d d+ #60 1 m*/ r> 0
      else  #10 * over c@ [char] 0 - +
     endif
     swap 1+ swap
   repeat
   -r nip s>d d+ ;
: timestrscan ( addr count -- d )
  1 1 LOCALS| c6 c1 |
  0. 2SWAP
  OVER + 1- ?DO
       I C@ DUP ':' =
       IF  DROP
           c6 #60 * TO c6
           1 TO C1
     ELSE  '0' -  C1 *  C6 M* D+
           #10 TO C1
    ENDIF
  -1 +LOOP ;
: TEST ( --  )
  CR ." \ dtimescan   : " S" 12:34:56" TICKS-RESET dtimescan
     TICKS? UD. ." clock ticks elapsed, " UD.
  CR ." \ timestrscan : " S" 12:34:56" TICKS-RESET timestrscan
     TICKS? UD. ." clock ticks elapsed, " UD. ;
  TEST
FORTH> in
\ dtimescan   : 1258 clock ticks elapsed, 45296
\ timestrscan : 419 clock ticks elapsed, 45296  ok
FORTH> TEST TEST TEST
\ dtimescan   : 1258 clock ticks elapsed, 45296
\ timestrscan : 419 clock ticks elapsed, 45296
\ dtimescan   : 419 clock ticks elapsed, 45296
\ timestrscan : 420 clock ticks elapsed, 45296
\ dtimescan   : 419 clock ticks elapsed, 45296
\ timestrscan : 420 clock ticks elapsed, 45296
FORTH>
A 'clock tick' is approximately 0.2ns.
-marcel

Date Sujet#  Auteur
11 Jun 25 * May the numbers speak32LIT
11 Jun 25 +* Re: May the numbers speak25LIT
11 Jun 25 i`* Re: May the numbers speak - supplement24LIT
11 Jun 25 i `* Re: May the numbers speak - supplement23minforth
12 Jun 25 i  `* Re: May the numbers speak - supplement22dxf
12 Jun 25 i   `* Re: May the numbers speak - supplement21Paul Rubin
12 Jun 25 i    +- Re: May the numbers speak - supplement1LIT
12 Jun 25 i    +* Re: May the numbers speak - supplement8mhx
12 Jun 25 i    i`* Re: May the numbers speak - supplement7Paul Rubin
12 Jun 25 i    i +* Re: May the numbers speak - supplement5mhx
12 Jun 25 i    i i`* Re: May the numbers speak - supplement4Paul Rubin
13 Jun 25 i    i i `* Re: May the numbers speak - supplement3mhx
13 Jun 25 i    i i  `* Re: May the numbers speak - supplement2Paul Rubin
13 Jun 25 i    i i   `- Re: May the numbers speak - supplement1mhx
13 Jun 25 i    i `- Re: May the numbers speak - supplement1dxf
12 Jun 25 i    +- Re: May the numbers speak - supplement1ahmed
12 Jun 25 i    +- Re: May the numbers speak - supplement1minforth
12 Jun 25 i    +* Re: May the numbers speak - supplement2B. Pym
12 Jun 25 i    i`- Re: May the numbers speak - supplement1Paul Rubin
12 Jun 25 i    +- Re: May the numbers speak - supplement1peter
12 Jun 25 i    `* Re: May the numbers speak - supplement6B. Pym
13 Jun 25 i     `* Re: May the numbers speak - supplement5dxf
13 Jun 25 i      +* Re: May the numbers speak - supplement3Hans Bezemer
13 Jun 25 i      i`* Re: May the numbers speak - supplement2Paul Rubin
14 Jun 25 i      i `- Re: May the numbers speak - supplement1dxf
15 Jun 25 i      `- Re: May the numbers speak - supplement1dxf
11 Jun 25 `* Re: May the numbers speak6dxf
11 Jun 25  `* Re: May the numbers speak5Hans Bezemer
12 Jun 25   +- Re: May the numbers speak1dxf
12 Jun 25   `* Re: May the numbers speak3sean
12 Jun 25    +- Re: May the numbers speak1mhx
12 Jun 25    `- Re: May the numbers speak1minforth

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal