本文整理汇总了TypeScript中timer.setInterval函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setInterval函数的具体用法?TypeScript setInterval怎么用?TypeScript setInterval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setInterval函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setContent
function setContent() {
myComponentInstance = builderModule.load({
path: "~/examples/",
name: xmlFileName
});
if (tabViewItem && tabViewItem.view) {
if (layout && layout.getChildrenCount() <= 0) {
timerId = timerModule.setInterval(function () {
toggleBusyIndicator(false);
layout.addChild(myComponentInstance);
timerModule.clearInterval(timerId);
}, 800);
}
}
}
示例2: trackVideoCurrentPosition
private trackVideoCurrentPosition(): number {
let trackInterval = setInterval(() => {
this.set('currentTime', this._videoPlayer.getCurrentTime());
}, 100);
return trackInterval;
}
示例3: function
startButton.addEventListener(buttonModule.Button.tapEvent, function () {
intervalId = timer.setInterval(intervalCallback, 100);
});
示例4: pageLoaded
milliseconds |= 0;
const hours = Math.floor(milliseconds / 1000 / 60 / 60);
const minutes = Math.floor(milliseconds / 1000 / 60 - hours * 60);
const seconds = Math.floor(milliseconds / 1000 - minutes * 60);
return `${zeroPadding(hours)}:${zeroPadding(minutes)}:${zeroPadding(seconds)}`;
}
});
const interval = timer.setInterval(() => {
let playing, duration, position;
if (myPlayer) {
playing = myPlayer.isPlaying();
duration = myPlayer.getDuration();
position = myPlayer.getCurrentPosition();
}
data.set('playing', playing);
data.set('duration', duration);
data.set('position', position);
}, 250);
export function pageLoaded(args) {
const page: Page = args.object;
page.bindingContext = data;
webView = page.getViewById("book-content");
}
export function play() {
if (myPlayer) {