如何在C#中引入延迟 [英] How to introduce delay in C#..

查看:78
本文介绍了如何在C#中引入延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨组,


如何在应用程序中引入几毫秒的延迟。我怎么做

实现这个...


让我清楚地说...

(1)我'' m显示切片的医学图像。

对于帧率[2x / 4x / 6x] - 为此我加载2 +片,4 +片循环

到有电影效果..->好的工作

(2)但是如果我想降低速度......我怎么能在中间引入延迟

切片.. [-2x / -4x / -6x ] ...-> ?????


我没有使用Threading..so我想不到睡觉。


Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak


Hi groups,

How i can introduce some milliseconds delay in application. How i can do
achieve this...

let me clearly say...
(1) I''m displaying slices of medical images.
For framerate [2x/4x/6x] - for this i''m loading 2+ slices, 4+ slices in loop
to have cine impact..-> Ok working
(2) But if i want to reduce the speed...how i can introduce delay inbetween
slices..[ -2x/-4x/-6x]...-> ?????

I''m not using Threading..so i cannot think of Sleep.

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak


推荐答案




要在c#中做一些延迟,请使用for循环,


for(i = 0; i< = delay; i ++);


根据你的延迟调整延迟值time.Here延迟很长。


" Maheshkumar.R"写道:
Hi,

To make some delay in c#,use the for Loops,

for(i=0;i<=delay;i++);

Adjust the delay value according to ur delay time.Here delay is a long int.

"Maheshkumar.R" wrote:
嗨组,

我如何在应用程序中引入一些毫秒的延迟。我该怎么做
实现这个......

让我清楚地说......
(1)我正在展示切片的医学影像。
帧速率[2x / 4x / 6x] - 为此我加载2 +片,4 +片循环
以影响电影...->好的工作
(2)但是如果我想降低速度......我怎么能在介于两个切片之间引入延迟.. [-2x / -4x / -6x] ...-> ?????

我没有使用Threading..so我想不到睡觉。

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak

Hi groups,

How i can introduce some milliseconds delay in application. How i can do
achieve this...

let me clearly say...
(1) I''m displaying slices of medical images.
For framerate [2x/4x/6x] - for this i''m loading 2+ slices, 4+ slices in loop
to have cine impact..-> Ok working
(2) But if i want to reduce the speed...how i can introduce delay inbetween
slices..[ -2x/-4x/-6x]...-> ?????

I''m not using Threading..so i cannot think of Sleep.

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak



没有aravind。我知道这个捷径。但我正在寻找关键字

透视或来自C#的任何内置函数......


Mahesh

Aravind ; <氩***** @ discussions.microsoft.com>在留言中写道

news:7B ********************************** @ microsof t.com ...
No aravind. I know this shortcut. But I''m looking something in Keyword
perspective or any inbuilt function from C#..

Mahesh
"Aravind" <Ar*****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...


要在c#中做一些延迟,请使用for循环,

for(i = 0; i< = delay; i ++);

根据你的延迟时间调整延迟值。这个延迟是一个很长的
int。
Maheshkumar.R写道:
Hi,

To make some delay in c#,use the for Loops,

for(i=0;i<=delay;i++);

Adjust the delay value according to ur delay time.Here delay is a long int.
"Maheshkumar.R" wrote:
嗨组,

我如何在应用程序中引入一些毫秒的延迟。我该怎么做
实现这个......

让我清楚地说......
(1)我正在展示切片的医学影像。
帧率[2x / 4x / 6x] - 为此我加载了2个以上的切片,
循环中的4 +切片以产生影响..->好的工作
(2)但是如果我想降低速度......我怎么能在片段之间引入延迟
.. [-2x / -4x / -6x] ...-> ?????

我没有使用Threading..so我想不到睡觉。

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak

Hi groups,

How i can introduce some milliseconds delay in application. How i can do
achieve this...

let me clearly say...
(1) I''m displaying slices of medical images.
For framerate [2x/4x/6x] - for this i''m loading 2+ slices, 4+ slices in loop to have cine impact..-> Ok working
(2) But if i want to reduce the speed...how i can introduce delay inbetween slices..[ -2x/-4x/-6x]...-> ?????

I''m not using Threading..so i cannot think of Sleep.

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak



Aravind< Ar ***** @ discussion.microsoft.com>写道:
Aravind <Ar*****@discussions.microsoft.com> wrote:
要在c#中做一些延迟,请使用for循环,

for(i = 0; i< = delay; i ++);

根据你的延迟时间调整延迟值。这是一个很长的延迟。
To make some delay in c#,use the for Loops,

for(i=0;i<=delay;i++);

Adjust the delay value according to ur delay time.Here delay is a long int.




不,这是一种可怕的延迟方式!它将处理器置于一个紧凑的循环中!


如果OP希望在UI中定期执行某些操作,那么

计时器是最好的选择:
http://www.pobox.com/~skeet/csharp/threads/timers.shtml

要延迟单个线程,请使用Thread.Sleep - 但不要做在

UI线程中,或者它会使UI无响应。


-

Jon Skeet - < sk ***@pobox.com>
http://www.pobox.com /〜双向飞碟

如果回复小组,请不要给我发邮件



No, that''s a terrible way of delaying! It puts the processor into a
tight loop!

If the OP wants to do something on a regular basis in a UI, then a
Timer is the best bet:
http://www.pobox.com/~skeet/csharp/threads/timers.shtml
To delay a single thread, use Thread.Sleep - but don''t do this in the
UI thread, or it will make the UI unresponsive.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


这篇关于如何在C#中引入延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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