__IntervalTimerInstruction class

The __IntervalTimerInstruction system class generates events at intervals, similar to a WM_TIMER message in Windows programming. An event consumer registers to receive interval timer events by creating an event query that references this class. Due to operating system behavior, there are no guarantees that events will be delivered at precisely the requested interval.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

class __IntervalTimerInstruction : __TimerInstruction
{
  uint32  IntervalBetweenEvents;
  boolean SkipIfPassed = FALSE;
  string  TimerId;
};

Members

The __IntervalTimerInstruction class has these types of members:

Properties

The __IntervalTimerInstruction class has these properties.

IntervalBetweenEvents

Data type: uint32

Access type: Read-only

Qualifiers: Units (milliseconds)

Number of milliseconds between event firings.

SkipIfPassed

Data type: boolean

Access type: Read-only

If TRUE, this event is to be skipped if the interval is already passed. The default is FALSE. This property is inherited from __TimerInstruction.

FALSE

When WMI or the consumer becomes available again, a notification event will be generated and received.

TRUE

The timer event does not occur if WMI is unavailable to generate it at the appropriate time interval, or the consumer requesting to receive the event is unavailable.

TimerId

Data type: string

Access type: Read-only

Qualifiers: Key

Unique identifier for this __IntervalTimerInstruction object. This property is inherited from __TimerInstruction.

Remarks

The __IntervalTimerInstruction class is derived from __TimerInstruction.

The event query entered to register for an interval timer event is usually based on the TimerId property. Notification events generated from an interval timer event contain the property NumFirings which contains data reflecting how many events fired during the time the events were unable to be received. If SkipIfPassed is set to TRUE, that information is discarded.

The value for the IntervalBetweenEvents property should be reasonably large. If it is too small, WMI may ignore it and not generate the event due to limitations in some operating systems.

WMI generates the interval timer event by creating an instance of the __TimerEvent class.

To receive these timer events in a temporary event consumer, execute IWbemServices::ExecNotificationQuery with the following event query string:

SELECT * FROM __TimerEvent WHERE TimerID = "MyEvent"

To receive these timer events in a permanent event consumer, you must load the previous query into an event filter, define a logical consumer, and create a filter-to-consumer binding for the filter and consumer. For more information, see Receiving Events at All Times.

Examples

The following MOF declaration shows how to generate an interval timer event with the key property set to "MyEvent" every 10 seconds:

instance of __IntervalTimerInstruction
{
  TimerId = "MyEvent";     // inherited from __TimerInstruction
  SkipIfPassed = FALSE;    // also inherited
  IntervalBetweenEvents = 10000;
};

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
All WMI namespaces

See also

__TimerInstruction

WMI System Classes

Receiving Timed or Repeating Events