Time delay without Thread

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anonymous

    Time delay without Thread

    Hi all.
    I have been programming a simple console application, and want to delay
    several seconds in the application for testing purpose.
    I've been searching google and this newsgroup, and I found out I could do so
    with Thread.Sleep method.
    I would like to, however, avoid creating threads if possible (since this is
    a simple application). Is there anyway to do it?

    Thank you.
  • Willy Denoyette [MVP]

    #2
    Re: Time delay without Thread


    "anonymous" <anonymous@disc ussions.microso ft.com> wrote in message
    news:AD9EA2A0-CA83-45D5-9911-FBD1FD4D9919@mi crosoft.com...[color=blue]
    > Hi all.
    > I have been programming a simple console application, and want to delay
    > several seconds in the application for testing purpose.
    > I've been searching google and this newsgroup, and I found out I could do
    > so
    > with Thread.Sleep method.
    > I would like to, however, avoid creating threads if possible (since this
    > is
    > a simple application). Is there anyway to do it?
    >
    > Thank you.[/color]

    System.Threadin g.Thread.Sleep is a static method, You don't have to create a
    thread in order to call it.

    Willy.


    Comment

    • Steve Walker

      #3
      Re: Time delay without Thread

      In message <OexonIjSFHA.37 20@TK2MSFTNGP10 .phx.gbl>, "Willy Denoyette
      [MVP]" <willy.denoyett e@telenet.be> writes[color=blue]
      >
      >"anonymous" <anonymous@disc ussions.microso ft.com> wrote in message
      >news:AD9EA2A 0-CA83-45D5-9911-FBD1FD4D9919@mi crosoft.com...[color=green]
      >> Hi all.
      >> I have been programming a simple console application, and want to delay
      >> several seconds in the application for testing purpose.
      >> I've been searching google and this newsgroup, and I found out I could do
      >> so
      >> with Thread.Sleep method.
      >> I would like to, however, avoid creating threads if possible (since this
      >> is
      >> a simple application). Is there anyway to do it?
      >>
      >> Thank you.[/color]
      >
      >System.Threadi ng.Thread.Sleep is a static method, You don't have to create a
      >thread in order to call it.[/color]

      And, further to this, calling it doesn't create a thread, it pauses the
      current one.

      --
      Steve Walker

      Comment

      Working...