在单独的线程中有1秒的定时器 [英] Timer with 1 Second In Separate Thread

查看:91
本文介绍了在单独的线程中有1秒的定时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我将有三个变量,其间隔值为

I will have three variable with interval values say

A [消息:这是A] = 5秒,B [消息:这是B] = 10秒,C [消息:这是C] = 5秒

A [Message : This is A]= 5 second , B [Message : This is B]= 10 second , C [Message : This is C]= 5 second

一旦计时器匹配,一秒计时器将在单独的线程中连续运行在三个变量中的任何一个中定义的间隔,它将打印相应的消息

one second timer will run continuously in separate thread once ticks in timer matches with the defined interval in any of the three variables it will print their corresponding message

程序将连续运行。

推荐答案

您好,

请提供更多信息。

A 计时器无法在线程中运行。使用SetTimer()设置的计时器属于主线程。

A timer cannot be run in a thread. Timers that are set with SetTimer() belong to the main thread.

关心Guido


这篇关于在单独的线程中有1秒的定时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆