Get Current Seconds Method

The Get Current Seconds method returns the number of seconds that have elapsed since midnight. You can use the Get Current Seconds method and the Randomize statement to seed the random number generator. For more information, see Randomize Method.

Format

Timer

This method does not include arguments.

Example

The following example uses the Get Current Seconds method to find Megabucks numbers:

Sub Button_Click
   Dim msgtext As String
   Dim value(9) As Single
   Dim nextvalue As Integer
   Dim x As Integer
   Dim y As Integer
   msgtext = "Your Megabucks numbers are: "
   For x = 1 to 8
      Do
         value(x) = Timer
         value(x) = value(x) * 100
         value(x) = Str(value(x))
         value(x) = Val(Right(value(x),2))
      Loop Until value(x)>1 and value(x)<36
      For y = 1 to 1500
      Next y
   Next x
   For y = 1 to 8
   For x = 1 to 8
      If y <> x then
         If value(y) = value(x) then
            value(x) = value(x) + 1
         End If
      End If
    Next x
   Next y
   For x = 1 to 8
      msgtext = msgtext & value(x) & " "
      Next x
End Sub