MonoDevelop/C#问题... [英] MonoDevelop / C# question...

查看:174
本文介绍了MonoDevelop/C#问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正在使用MonoDevelop使用C#语言在Linux中编写程序.在给定的毫秒数后如何执行任务,并使其重复该过程? (基本上,它等效于MonoDevelop中的Timer控件).我正在寻找一种方法来执行此操作,但尚未找到它.

All right, I am using MonoDevelop to make a program in Linux, using the C# language. How can I perform a task after a given amount of milliseconds, and have it repeat the process? (Basically, the equivalent of a Timer control in MonoDevelop). I have looked for a way to do this, but haven''t found it.

推荐答案

Thread.Sleep是否在.Net的Mono版本中起作用(FYI,除了使用Mono限制外,使用MonoDevelop或Visual Studio开发的程序也可以在Microsoft .Net Framework和Mono .Net Framework上运行都没有关系吗?

如果它确实起作用,那么您可以创建一个新线程,然后让它与Thread.Sleep不断循环,以帮助您随着时间的流逝而进行处理.
Does Thread.Sleep work in the Mono version of .Net (FYI, it doesn''t really matter that you''re using MonoDevelop... programs developed with either MonoDevelop or Visual Studio will run under both the Microsoft .Net Framework and the Mono .Net Framework, aside from the Mono limitations)?

If it does work, then you can create a new thread, then just have it continually loop with a Thread.Sleep to help you space out processing over time.


这篇关于MonoDevelop/C#问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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