DispatcherTimer.Interval 속성

정의

타이머 틱 사이의 시간 간격을 가져오거나 설정합니다.

public:
 property TimeSpan Interval { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan Interval { get; set; }
member this.Interval : TimeSpan with get, set
Public Property Interval As TimeSpan

속성 값

틱 사이의 시간 간격입니다. 기본값은 00:00:00입니다.

예외

interval 가 0보다 작거나 Int32.MaxValue 밀리초보다 큽니다.

예제

다음 예제에서는 DispatcherTimer합니다. 새 DispatcherTimer 개체인 dispatcherTimer 만들어집니다. 이벤트 처리기 dispatcherTimer_Tick 에 추가 되는 Tick 이벤트입니다. 합니다 Interval 를 사용 하 여 1 초로 설정 됩니다는 TimeSpan 개체입니다.

//  DispatcherTimer setup
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
dispatcherTimer.Start();
'  DispatcherTimer setup
dispatcherTimer = New Threading.DispatcherTimer()
AddHandler dispatcherTimer.Tick, AddressOf dispatcherTimer_Tick
dispatcherTimer.Interval = New TimeSpan(0,0,1)
dispatcherTimer.Start()

설명

타이머 간격 발생 하지만가 시간 간격이 발생 하기 전에 실행 되지 않도록 보장 됩니다 될 때 정확 하 게 실행 되도록 보장 되지 않습니다. 왜냐하면 DispatcherTimer 작업에 배치 되는 Dispatcher 다른 작업 처럼 큐입니다. 경우는 DispatcherTimer 작업이 실행 되는 큐 및 해당 우선 순위에 있는 다른 작업에 따라 달라 집니다.

적용 대상