Where is the right place to initialize a Timer

rpsj

Member
Licensed User
Longtime User
Hi !
I have to use a Timer and I do not know where is the best place to initialize it !
What is best ?
In Process_globals :

B4X:
Sub Process_Globals
  Dim tm as Timer
  tm.Initialize ("tm", 1000)
End Sub

Or in Activity_Create :

B4X:
Sub Process_Globals
  Dim tm as Timer
End Sub

Sub Activity_Create(FirstTime As Boolean)
  tm.Initialize ("tm", 1000)
  ...
End Sub

Or in Activity_Create only in FirstTime :

B4X:
Sub Process_Globals
  Dim tm as Timer
End Sub

Sub Activity_Create(FirstTime As Boolean)
  if FirstTime = True then
    tm.Initialize ("tm", 1000)
  EndIf
  ...
End Sub

Thanks

Rubens Jr. :sign0104:
 
Top