Timers Object

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

The Timers object is a collection of Timer objects. Its methods and properties provide a scripting interface to Timer objects, let you create new and delete existing Timer objects, etc. To obtain the Timers collection in scripts, use the Timers property of the Utils object.

Members

Example

The code below demonstrates how you can use the Utils.Timers property to obtain the Timers collection and how to obtain the desired Timer object from this collection.

JavaScript, JScript

function TestProc()
{
  // Obtains the Timers collection
  TimersCollection = Utils.Timers;

  // Obtains the first object in the Timers collection
  Timer = TimersCollection.Items(0); // Obtains a timer by its index or name
  // ...
}

Python

def TestProc():
  # Obtains the Timers collection
  TimersCollection = Utils.Timers

  # Obtains the first object in the Timers collection
  Timer = TimersCollection.Items[0] # Obtains a timer by its index or name
  # ...

VBScript

Sub TestProc
  ' Obtains the Timers collection
  Set TimersCollection = Utils.Timers

  ' Obtains the first object in the Timers collection
  Set Timer = TimersCollection.Items(0) ' Obtains a timer by its index or name
  ' ...
End Sub

DelphiScript

procedure TestProc;
var
  TimersCollection, Timer : OleVariant;
begin
  //Obtains the Timers collection
  TimersCollection := Utils.Timers;

  // Obtains the first object in the Timers collection
  Timer := TimersCollection.Items[0]; // Obtains a timer by its index or name
  // ...
end;

C++Script, C#Script

function TestProc()
{
  var TimersCollection, Timer;
  // Obtains the Timers collection
  TimersCollection = Utils["Timers"];

  // Obtains the first object in the Timers collection
    Timer = TimersCollection["Items"](0); // Obtains a timer by its index or name
  // ...
}

See Also

Using Timers
Timer Object
Utils Object

Highlight search results