Announcement

Collapse
No announcement yet.

Timer speed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dale Yarker
    replied
    Code:
    '
    Function Faux_Timer As Dword
      'Less calls to Timer?
     
      Incr Faux_Timer_Ctr
      If Faux_Timer_Ctr [COLOR="Blue"][b]= 101[/b][/COLOR] Then
         Reset Faux_Timer_Ctr
         Last_Timer_Set = Timer
      End If
      Function = Last_Timer_Set
     
    End Function
    '
    I believe greater than is more expensive then equals. Does change above help the speed?

    Cheers,

    Leave a comment:


  • Gösta H. Lovgren-2
    started a topic Timer speed

    Timer speed

    In the Life program, Timer is called hundreds of times a second. It's always been my understanding calls to Timer are "expensive" (CPU time eaters) so I thought maybe I could get around at least some of the cost by using
    Code:
    '
    Function Faux_Timer As Dword
      'Less calls to Timer?
     
      Incr Faux_Timer_Ctr
      If Faux_Timer_Ctr > 100 Then
         Reset Faux_Timer_Ctr
         Last_Timer_Set = Timer
      End If
      Function = Last_Timer_Set
     
    End Function
    '
    and substituting "Faux_Timer" for "Timer" in the code but there isn't any appreciable times savings, slower even if anything.

    Just another blind alley going up in smoke, I guess. {sigh}

    ============================================
    People will not remember
    what you did or what you said.
    People will remember how you made them feel.
    LadyHawke
    ============================================
    Last edited by Gösta H. Lovgren-2; 9 Nov 2008, 12:06 AM.
Working...
X