Timer.Change Yöntem

Tanım

Zamanlayıcının başlangıç saatini ve yöntem çağrıları arasındaki aralığı değiştirir.

Aşırı Yüklemeler

Change(Int32, Int32)

Zaman aralıklarını ölçmek için 32 bit imzalı tamsayılar kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

Change(Int64, Int64)

Zaman aralıklarını ölçmek için 64 bit imzalı tamsayıları kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

Change(TimeSpan, TimeSpan)

Zaman aralıklarını ölçmek için değerleri kullanarak TimeSpan bir zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

Change(UInt32, UInt32)

Zaman aralıklarını ölçmek için 32 bit işaretsiz tamsayılar kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

Change(Int32, Int32)

Kaynak:
Timer.cs
Kaynak:
Timer.cs
Kaynak:
Timer.cs

Zaman aralıklarını ölçmek için 32 bit imzalı tamsayılar kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

public:
 bool Change(int dueTime, int period);
public bool Change (int dueTime, int period);
member this.Change : int * int -> bool
Public Function Change (dueTime As Integer, period As Integer) As Boolean

Parametreler

dueTime
Int32

oluşturulduğu sırada Timer belirtilen geri çağırma yöntemini çağırmadan önce gecikme süresi (milisaniye cinsinden). Zamanlayıcının yeniden başlatılmasını önlemek için belirtin Infinite . Zamanlayıcıyı hemen yeniden başlatmak için sıfır (0) belirtin.

period
Int32

oluşturulduğu sırada Timer belirtilen geri çağırma yönteminin çağrıları arasındaki zaman aralığı (milisaniye cinsinden). Düzenli sinyallerin devre dışı bırakılacağını belirtin Infinite .

Döndürülenler

true zamanlayıcı başarıyla güncelleştirildiyse; aksi takdirde , false.

Özel durumlar

Timer zaten atılmış.

dueTime veya period parametresi negatiftir ve değerine Infiniteeşit değildir.

Örnekler

Aşağıdaki kod örneği, bir ve başlatma işleminin Timer , belirli sayıda çağrıdan sonra dönemini nasıl değiştireceğini gösterir.

using namespace System;
using namespace System::Threading;

ref class StatusChecker
{
private:
    int invokeCount, maxCount;

public:
    StatusChecker(int count)
    {
        invokeCount  = 0;
        maxCount = count;
    }

    // This method is called by the timer delegate.
    void CheckStatus(Object^ stateInfo)
    {
        AutoResetEvent^ autoEvent = dynamic_cast<AutoResetEvent^>(stateInfo);
        Console::WriteLine("{0:h:mm:ss.fff} Checking status {1,2}.",
                           DateTime::Now, ++invokeCount);

        if (invokeCount == maxCount) {
            // Reset the counter and signal the waiting thread.
            invokeCount  = 0;
            autoEvent->Set();
        }
    }
};

ref class TimerExample
{
public:
    static void Main()
    {
        // Create an AutoResetEvent to signal the timeout threshold in the
        // timer callback has been reached.
        AutoResetEvent^ autoEvent = gcnew AutoResetEvent(false);

        StatusChecker^ statusChecker = gcnew StatusChecker(10);

        // Create a delegate that invokes methods for the timer.
        TimerCallback^ tcb =
           gcnew TimerCallback(statusChecker, &StatusChecker::CheckStatus);

        // Create a timer that invokes CheckStatus after one second, 
        // and every 1/4 second thereafter.
        Console::WriteLine("{0:h:mm:ss.fff} Creating timer.\n",
                           DateTime::Now);
        Timer^ stateTimer = gcnew Timer(tcb, autoEvent, 1000, 250);

        // When autoEvent signals, change the period to every half second.
        autoEvent->WaitOne(5000, false);
        stateTimer->Change(0, 500);
        Console::WriteLine("\nChanging period to .5 seconds.\n");

        // When autoEvent signals the second time, dispose of the timer.
        autoEvent->WaitOne(5000, false);
        stateTimer->~Timer();
        Console::WriteLine("\nDestroying timer.");
    }
};

int main()
{
    TimerExample::Main();
}
// The example displays output like the following:
//       11:59:54.202 Creating timer.
//       
//       11:59:55.217 Checking status  1.
//       11:59:55.466 Checking status  2.
//       11:59:55.716 Checking status  3.
//       11:59:55.968 Checking status  4.
//       11:59:56.218 Checking status  5.
//       11:59:56.470 Checking status  6.
//       11:59:56.722 Checking status  7.
//       11:59:56.972 Checking status  8.
//       11:59:57.223 Checking status  9.
//       11:59:57.473 Checking status 10.
//       
//       Changing period to .5 seconds.
//       
//       11:59:57.474 Checking status  1.
//       11:59:57.976 Checking status  2.
//       11:59:58.476 Checking status  3.
//       11:59:58.977 Checking status  4.
//       11:59:59.477 Checking status  5.
//       11:59:59.977 Checking status  6.
//       12:00:00.478 Checking status  7.
//       12:00:00.980 Checking status  8.
//       12:00:01.481 Checking status  9.
//       12:00:01.981 Checking status 10.
//       
//       Destroying timer.
using System;
using System.Threading;

class TimerExample
{
    static void Main()
    {
        // Create an AutoResetEvent to signal the timeout threshold in the
        // timer callback has been reached.
        var autoEvent = new AutoResetEvent(false);
        
        var statusChecker = new StatusChecker(10);

        // Create a timer that invokes CheckStatus after one second, 
        // and every 1/4 second thereafter.
        Console.WriteLine("{0:h:mm:ss.fff} Creating timer.\n", 
                          DateTime.Now);
        var stateTimer = new Timer(statusChecker.CheckStatus, 
                                   autoEvent, 1000, 250);

        // When autoEvent signals, change the period to every half second.
        autoEvent.WaitOne();
        stateTimer.Change(0, 500);
        Console.WriteLine("\nChanging period to .5 seconds.\n");

        // When autoEvent signals the second time, dispose of the timer.
        autoEvent.WaitOne();
        stateTimer.Dispose();
        Console.WriteLine("\nDestroying timer.");
    }
}

class StatusChecker
{
    private int invokeCount;
    private int  maxCount;

    public StatusChecker(int count)
    {
        invokeCount  = 0;
        maxCount = count;
    }

    // This method is called by the timer delegate.
    public void CheckStatus(Object stateInfo)
    {
        AutoResetEvent autoEvent = (AutoResetEvent)stateInfo;
        Console.WriteLine("{0} Checking status {1,2}.", 
            DateTime.Now.ToString("h:mm:ss.fff"), 
            (++invokeCount).ToString());

        if(invokeCount == maxCount)
        {
            // Reset the counter and signal the waiting thread.
            invokeCount = 0;
            autoEvent.Set();
        }
    }
}
// The example displays output like the following:
//       11:59:54.202 Creating timer.
//       
//       11:59:55.217 Checking status  1.
//       11:59:55.466 Checking status  2.
//       11:59:55.716 Checking status  3.
//       11:59:55.968 Checking status  4.
//       11:59:56.218 Checking status  5.
//       11:59:56.470 Checking status  6.
//       11:59:56.722 Checking status  7.
//       11:59:56.972 Checking status  8.
//       11:59:57.223 Checking status  9.
//       11:59:57.473 Checking status 10.
//       
//       Changing period to .5 seconds.
//       
//       11:59:57.474 Checking status  1.
//       11:59:57.976 Checking status  2.
//       11:59:58.476 Checking status  3.
//       11:59:58.977 Checking status  4.
//       11:59:59.477 Checking status  5.
//       11:59:59.977 Checking status  6.
//       12:00:00.478 Checking status  7.
//       12:00:00.980 Checking status  8.
//       12:00:01.481 Checking status  9.
//       12:00:01.981 Checking status 10.
//       
//       Destroying timer.
Imports System.Threading

Public Module Example
    Public Sub Main()
        ' Use an AutoResetEvent to signal the timeout threshold in the
        ' timer callback has been reached.
        Dim autoEvent As New AutoResetEvent(False)

        Dim statusChecker As New StatusChecker(10)

        ' Create a timer that invokes CheckStatus after one second, 
        ' and every 1/4 second thereafter.
        Console.WriteLine("{0:h:mm:ss.fff} Creating timer." & vbCrLf, 
                          DateTime.Now)
        Dim stateTimer As New Timer(AddressOf statusChecker.CheckStatus, 
                                    autoEvent, 1000, 250)

        ' When autoEvent signals, change the period to every half second.
        autoEvent.WaitOne()
        stateTimer.Change(0, 500)
        Console.WriteLine(vbCrLf & "Changing period to .5 seconds." & vbCrLf)

        ' When autoEvent signals the second time, dispose of the timer.
        autoEvent.WaitOne()
        stateTimer.Dispose()
        Console.WriteLine(vbCrLf & "Destroying timer.")
    End Sub
End Module

Public Class StatusChecker
    Dim invokeCount, maxCount As Integer 

    Sub New(count As Integer)
        invokeCount  = 0
        maxCount = count
    End Sub

    ' The timer callback method.
    Sub CheckStatus(stateInfo As Object)
        Dim autoEvent As AutoResetEvent = DirectCast(stateInfo, AutoResetEvent)
        invokeCount += 1
        Console.WriteLine("{0:h:mm:ss.fff} Checking status {1,2}.", 
                          DateTime.Now, invokeCount)
        If invokeCount = maxCount Then
            ' Reset the counter and signal the waiting thread.
            invokeCount = 0
            autoEvent.Set()
        End If
    End Sub
End Class
' The example displays output like the following:
'       11:59:54.202 Creating timer.
'       
'       11:59:55.217 Checking status  1.
'       11:59:55.466 Checking status  2.
'       11:59:55.716 Checking status  3.
'       11:59:55.968 Checking status  4.
'       11:59:56.218 Checking status  5.
'       11:59:56.470 Checking status  6.
'       11:59:56.722 Checking status  7.
'       11:59:56.972 Checking status  8.
'       11:59:57.223 Checking status  9.
'       11:59:57.473 Checking status 10.
'       
'       Changing period to .5 seconds.
'       
'       11:59:57.474 Checking status  1.
'       11:59:57.976 Checking status  2.
'       11:59:58.476 Checking status  3.
'       11:59:58.977 Checking status  4.
'       11:59:59.477 Checking status  5.
'       11:59:59.977 Checking status  6.
'       12:00:00.478 Checking status  7.
'       12:00:00.980 Checking status  8.
'       12:00:01.481 Checking status  9.
'       12:00:01.981 Checking status 10.
'       
'       Destroying timer.

Açıklamalar

Geri çağırma yöntemi, geçtikten sonra dueTime bir kez ve ardından tarafından period belirtilen zaman aralığı her geçtiğinde çağrılır.

Sıfır (0) ise dueTime geri çağırma yöntemi hemen çağrılır. ise dueTimeTimeout.Infinite, geri çağırma yöntemi hiçbir zaman çağrılmazsa; zamanlayıcı devre dışı bırakılır, ancak çağrılarak Change ve için dueTimepozitif bir değer belirtilerek yeniden etkinleştirilebilir.

sıfır (0) veya ise period ve dueTime değilseTimeout.Infinite, geri çağırma yöntemi bir kez çağrılır; zamanlayıcının düzenli davranışı devre dışı bırakılır, ancak için pozitif bir değer periodçağrılarak Change ve Timeout.Infinitebelirtilerek yeniden etkinleştirilebilir.

Change yöntemi temsilciden TimerCallback çağrılabilir.

Ayrıca bkz.

Şunlara uygulanır

Change(Int64, Int64)

Kaynak:
Timer.cs
Kaynak:
Timer.cs
Kaynak:
Timer.cs

Zaman aralıklarını ölçmek için 64 bit imzalı tamsayıları kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

public:
 bool Change(long dueTime, long period);
public bool Change (long dueTime, long period);
member this.Change : int64 * int64 -> bool
Public Function Change (dueTime As Long, period As Long) As Boolean

Parametreler

dueTime
Int64

oluşturulduğu sırada Timer belirtilen geri çağırma yöntemini çağırmadan önce gecikme süresi (milisaniye cinsinden). Zamanlayıcının yeniden başlatılmasını önlemek için belirtin Infinite . Zamanlayıcıyı hemen yeniden başlatmak için sıfır (0) belirtin. Bu değer 4294967294 küçük veya buna eşit olmalıdır.

period
Int64

oluşturulduğu sırada Timer belirtilen geri çağırma yönteminin çağrıları arasındaki zaman aralığı (milisaniye cinsinden). Düzenli sinyallerin devre dışı bırakılacağını belirtin Infinite .

Döndürülenler

true zamanlayıcı başarıyla güncelleştirildiyse; aksi takdirde , false.

Özel durumlar

Timer zaten atılmış.

dueTime veya period -1'den küçüktür.

-veya-

dueTime veya period 4294967294 büyüktür.

Açıklamalar

Geri çağırma yöntemi, geçtikten sonra dueTime bir kez ve ardından tarafından period belirtilen zaman aralığı her geçtiğinde çağrılır.

Sıfır (0) ise dueTime geri çağırma yöntemi hemen çağrılır. ise dueTimeTimeout.Infinite, geri çağırma yöntemi hiçbir zaman çağrılmazsa; zamanlayıcı devre dışı bırakılır, ancak çağrılarak Change ve için dueTimepozitif bir değer belirtilerek yeniden etkinleştirilebilir.

sıfır (0) veya ise period ve dueTime değilseTimeout.Infinite, geri çağırma yöntemi bir kez çağrılır; zamanlayıcının düzenli davranışı devre dışı bırakılır, ancak için pozitif bir değer periodçağrılarak Change ve Timeout.Infinitebelirtilerek yeniden etkinleştirilebilir.

Change yöntemi temsilciden TimerCallback çağrılabilir.

Ayrıca bkz.

Şunlara uygulanır

Change(TimeSpan, TimeSpan)

Kaynak:
Timer.cs
Kaynak:
Timer.cs
Kaynak:
Timer.cs

Zaman aralıklarını ölçmek için değerleri kullanarak TimeSpan bir zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

public:
 bool Change(TimeSpan dueTime, TimeSpan period);
public:
 virtual bool Change(TimeSpan dueTime, TimeSpan period);
public bool Change (TimeSpan dueTime, TimeSpan period);
member this.Change : TimeSpan * TimeSpan -> bool
abstract member Change : TimeSpan * TimeSpan -> bool
override this.Change : TimeSpan * TimeSpan -> bool
Public Function Change (dueTime As TimeSpan, period As TimeSpan) As Boolean

Parametreler

dueTime
TimeSpan

TimeSpan oluşturulduğunda belirtilen Timer geri çağırma yöntemini çağırmadan önce geciktirilmesi gereken süreyi temsil eden. Zamanlayıcının yeniden başlatılmasını önlemek için belirtin InfiniteTimeSpan . Zamanlayıcıyı hemen yeniden başlatmak için belirtin Zero .

period
TimeSpan

oluşturulduğu sırada Timer belirtilen geri çağırma yönteminin çağrıları arasındaki zaman aralığı. Düzenli sinyallerin devre dışı bırakılacağını belirtin InfiniteTimeSpan .

Döndürülenler

true zamanlayıcı başarıyla güncelleştirildiyse; aksi takdirde , false.

Uygulamalar

Özel durumlar

Timer zaten atılmış.

dueTime milisaniye cinsinden veya period parametresi -1'den küçüktür.

dueTime milisaniye cinsinden veya period parametresi 4294967294 büyüktür.

Örnekler

Aşağıdaki kod örneği, bir ve başlatma işleminin Timer , belirli sayıda çağrıdan sonra dönemini nasıl değiştireceğini gösterir.

using namespace System;
using namespace System::Threading;
ref class StatusChecker
{
private:
   int invokeCount;
   int maxCount;

public:
   StatusChecker( int count )
      : invokeCount( 0 ), maxCount( count )
   {}


   // This method is called by the timer delegate.
   void CheckStatus( Object^ stateInfo )
   {
      AutoResetEvent^ autoEvent = dynamic_cast<AutoResetEvent^>(stateInfo);
      Console::WriteLine( "{0} Checking status {1,2}.", DateTime::Now.ToString(  "h:mm:ss.fff" ), (++invokeCount).ToString() );
      if ( invokeCount == maxCount )
      {
         
         // Reset the counter and signal main.
         invokeCount = 0;
         autoEvent->Set();
      }
   }

};

int main()
{
   AutoResetEvent^ autoEvent = gcnew AutoResetEvent( false );
   StatusChecker^ statusChecker = gcnew StatusChecker( 10 );
   
   // Create the delegate that invokes methods for the timer.
   TimerCallback^ timerDelegate = gcnew TimerCallback( statusChecker, &StatusChecker::CheckStatus );
   TimeSpan delayTime = TimeSpan(0,0,1);
   TimeSpan intervalTime = TimeSpan(0,0,0,0,250);
   
   // Create a timer that signals the delegate to invoke CheckStatus 
   // after one second, and every 1/4 second thereafter.
   Console::WriteLine( "{0} Creating timer.\n", DateTime::Now.ToString(  "h:mm:ss.fff" ) );
   Timer^ stateTimer = gcnew Timer( timerDelegate,autoEvent,delayTime,intervalTime );
   
   // When autoEvent signals, change the period to every 1/2 second.
   autoEvent->WaitOne( 5000, false );
   stateTimer->Change( TimeSpan(0), intervalTime + intervalTime );
   Console::WriteLine( "\nChanging period.\n" );
   
   // When autoEvent signals the second time, dispose of the timer.
   autoEvent->WaitOne( 5000, false );
   stateTimer->~Timer();
   Console::WriteLine( "\nDestroying timer." );
}
using System;
using System.Threading;

class TimerExample
{
    static void Main()
    {
        AutoResetEvent autoEvent     = new AutoResetEvent(false);
        StatusChecker  statusChecker = new StatusChecker(10);

        // Create the delegate that invokes methods for the timer.
        TimerCallback timerDelegate = 
            new TimerCallback(statusChecker.CheckStatus);

        TimeSpan delayTime = new TimeSpan(0, 0, 1);
        TimeSpan intervalTime = new TimeSpan(0, 0, 0, 0, 250);

        // Create a timer that signals the delegate to invoke 
        // CheckStatus after one second, and every 1/4 second 
        // thereafter.
        Console.WriteLine("{0} Creating timer.\n", 
            DateTime.Now.ToString("h:mm:ss.fff"));
        Timer stateTimer = new Timer(
            timerDelegate, autoEvent, delayTime, intervalTime);

        // When autoEvent signals, change the period to every 
        // 1/2 second.
        autoEvent.WaitOne(5000, false);
        stateTimer.Change(new TimeSpan(0), 
            intervalTime + intervalTime);
        Console.WriteLine("\nChanging period.\n");

        // When autoEvent signals the second time, dispose of 
        // the timer.
        autoEvent.WaitOne(5000, false);
        stateTimer.Dispose();
        Console.WriteLine("\nDestroying timer.");
    }
}

class StatusChecker
{
    int invokeCount, maxCount;

    public StatusChecker(int count)
    {
        invokeCount  = 0;
        maxCount = count;
    }

    // This method is called by the timer delegate.
    public void CheckStatus(Object stateInfo)
    {
        AutoResetEvent autoEvent = (AutoResetEvent)stateInfo;
        Console.WriteLine("{0} Checking status {1,2}.", 
            DateTime.Now.ToString("h:mm:ss.fff"), 
            (++invokeCount).ToString());

        if(invokeCount == maxCount)
        {
            // Reset the counter and signal Main.
            invokeCount  = 0;
            autoEvent.Set();
        }
    }
}
Imports System.Threading

Public Class TimerExample

    <MTAThread> _
    Shared Sub Main()
    
        Dim autoEvent As New AutoResetEvent(False)
        Dim statusChecker As New StatusChecker(10)

        ' Create the delegate that invokes methods for the timer.
        Dim timerDelegate As TimerCallback = _
            AddressOf statusChecker.CheckStatus

        Dim delayTime As New TimeSpan(0, 0, 1)
        Dim intervalTime As New TimeSpan(0, 0, 0, 0, 250)

        ' Create a timer that signals the delegate to invoke 
        ' CheckStatus after one second, and every 1/4 second 
        ' thereafter.
        Console.WriteLine("{0} Creating timer." & vbCrLf, _
            DateTime.Now.ToString("h:mm:ss.fff"))
        Dim stateTimer As Timer = New Timer( _
            timerDelegate, autoEvent, delayTime, intervalTime)

        ' When autoEvent signals, change the period to every 
        ' 1/2 second.
        autoEvent.WaitOne(5000, False)
        stateTimer.Change( _
            new TimeSpan(0), intervalTime.Add(intervalTime))
        Console.WriteLine(vbCrLf & "Changing period." & vbCrLf)

        ' When autoEvent signals the second time, dispose of 
        ' the timer.
        autoEvent.WaitOne(5000, False)
        stateTimer.Dispose()
        Console.WriteLine(vbCrLf & "Destroying timer.")
    
    End Sub
End Class

Public Class StatusChecker

    Dim invokeCount, maxCount As Integer 

    Sub New(count As Integer)
        invokeCount  = 0
        maxCount = count
    End Sub

    ' This method is called by the timer delegate.
    Sub CheckStatus(stateInfo As Object)
        Dim autoEvent As AutoResetEvent = _
            DirectCast(stateInfo, AutoResetEvent)
        invokeCount += 1
        Console.WriteLine("{0} Checking status {1,2}.", _
            DateTime.Now.ToString("h:mm:ss.fff"), _
            invokeCount.ToString())

        If invokeCount = maxCount Then
        
            ' Reset the counter and signal to stop the timer.
            invokeCount  = 0
            autoEvent.Set()
        End If
    End Sub

End Class

Açıklamalar

Geri çağırma yöntemi, geçtikten sonra dueTime bir kez ve ardından tarafından period belirtilen zaman aralığı her geçtiğinde çağrılır.

ise dueTimeTimeSpan.Zero, geri çağırma yöntemi hemen çağrılır. ise dueTimeInfiniteTimeSpan, geri çağırma yöntemi hiçbir zaman çağrılmazsa; zamanlayıcı devre dışı bırakılır, ancak çağrılarak Change ve için dueTimepozitif bir değer belirtilerek yeniden etkinleştirilebilir.

periodTimeSpan.Zero veya InfiniteTimeSpanise ve dueTime pozitifse, geri çağırma yöntemi bir kez çağrılır; zamanlayıcının düzenli davranışı devre dışı bırakılır, ancak için periodsıfırdan büyük bir değer çağrılarak Change ve belirtilerek yeniden etkinleştirilebilir.

Change yöntemi temsilciden TimerCallback çağrılabilir.

Ayrıca bkz.

Şunlara uygulanır

Change(UInt32, UInt32)

Kaynak:
Timer.cs
Kaynak:
Timer.cs
Kaynak:
Timer.cs

Önemli

Bu API, CLS uyumlu değildir.

Zaman aralıklarını ölçmek için 32 bit işaretsiz tamsayılar kullanarak zamanlayıcı için yöntem çağrıları arasındaki başlangıç saatini ve aralığı değiştirir.

public:
 bool Change(System::UInt32 dueTime, System::UInt32 period);
[System.CLSCompliant(false)]
public bool Change (uint dueTime, uint period);
[<System.CLSCompliant(false)>]
member this.Change : uint32 * uint32 -> bool
Public Function Change (dueTime As UInteger, period As UInteger) As Boolean

Parametreler

dueTime
UInt32

oluşturulduğu sırada Timer belirtilen geri çağırma yöntemini çağırmadan önce gecikme süresi (milisaniye cinsinden). Zamanlayıcının yeniden başlatılmasını önlemek için belirtin Infinite . Zamanlayıcıyı hemen yeniden başlatmak için sıfır (0) belirtin.

period
UInt32

oluşturulduğu sırada Timer belirtilen geri çağırma yönteminin çağrıları arasındaki zaman aralığı (milisaniye cinsinden). Düzenli sinyallerin devre dışı bırakılacağını belirtin Infinite .

Döndürülenler

true zamanlayıcı başarıyla güncelleştirildiyse; aksi takdirde , false.

Öznitelikler

Özel durumlar

Timer zaten atılmış.

Açıklamalar

Geri çağırma yöntemi, geçtikten sonra dueTime bir kez ve ardından tarafından period belirtilen zaman aralığı her geçtiğinde çağrılır.

Sıfır (0) ise dueTime geri çağırma yöntemi hemen çağrılır. ise dueTimeTimeout.Infinite, geri çağırma yöntemi hiçbir zaman çağrılmazsa; zamanlayıcı devre dışı bırakılır, ancak çağrılarak Change ve için dueTimepozitif bir değer belirtilerek yeniden etkinleştirilebilir.

sıfır (0) veya ise period ve dueTime değilseTimeout.Infinite, geri çağırma yöntemi bir kez çağrılır; zamanlayıcının düzenli davranışı devre dışı bırakılır, ancak için pozitif bir değer periodçağrılarak Change ve Timeout.Infinitebelirtilerek yeniden etkinleştirilebilir.

Change yöntemi temsilciden TimerCallback çağrılabilir.

Ayrıca bkz.

Şunlara uygulanır