Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Sleep in an application

Sleep in an application

Scheduled Pinned Locked Moved C#
databasehelpquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    C Scharbe
    wrote on last edited by
    #1

    hello, can i some how sleep a process in an application?: my problem is i want to execute a sql string. if it failed i want wait some (milli)seconds before i repeat the execution thank you

    B A 2 Replies Last reply
    0
    • C C Scharbe

      hello, can i some how sleep a process in an application?: my problem is i want to execute a sql string. if it failed i want wait some (milli)seconds before i repeat the execution thank you

      B Offline
      B Offline
      baerten
      wrote on last edited by
      #2

      Hi, use a sleep(x); in your function Regards

      C 1 Reply Last reply
      0
      • B baerten

        Hi, use a sleep(x); in your function Regards

        C Offline
        C Offline
        C Scharbe
        wrote on last edited by
        #3

        but where can i find it?!

        N 1 Reply Last reply
        0
        • C C Scharbe

          hello, can i some how sleep a process in an application?: my problem is i want to execute a sql string. if it failed i want wait some (milli)seconds before i repeat the execution thank you

          A Offline
          A Offline
          abhinish
          wrote on last edited by
          #4

          hi! use Thread.Sleep(5000); // this will sleep the thread for 5 seconds

          abhinav

          C 1 Reply Last reply
          0
          • C C Scharbe

            but where can i find it?!

            N Offline
            N Offline
            Nader Elshehabi
            wrote on last edited by
            #5

            Call

            Thread.Sleep(1000);

            to sleep for one second. Yet, if you do this in your main Thread, this will cause your UI to freeze.

            Regards:rose:

            1 Reply Last reply
            0
            • A abhinish

              hi! use Thread.Sleep(5000); // this will sleep the thread for 5 seconds

              abhinav

              C Offline
              C Offline
              C Scharbe
              wrote on last edited by
              #6

              yes, thank you. thats it.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups