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. Visual Basic
  4. How to make the system sleep for a while.

How to make the system sleep for a while.

Scheduled Pinned Locked Moved Visual Basic
questioncsharpjsontutorial
2 Posts 2 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.
  • S Offline
    S Offline
    SekharOne
    wrote on last edited by
    #1

    How can I make the system sleep for a while so that in the meanwhile my files get populated with some data and after that I can access the file for processing. Is there any way in vb.net or I have to call some API functions ? Thanks in Advance.

    Sekhar :)

    R 1 Reply Last reply
    0
    • S SekharOne

      How can I make the system sleep for a while so that in the meanwhile my files get populated with some data and after that I can access the file for processing. Is there any way in vb.net or I have to call some API functions ? Thanks in Advance.

      Sekhar :)

      R Offline
      R Offline
      RichardBerry
      wrote on last edited by
      #2

      System.Threading.Thread.Sleep(1000) '1000 Milli Second delay Or you can use a different thread to do the population of the files. Private Sub PopulateFiles ..... End Sub Use the lines below in one of your Procedures, which then calls the PopulateFiles procedure on a new thread. Dim thPopulateFiles As New System.Threading.Thread(AddressOf PopulateFiles) thPopulateFiles.Start() It can be tricky if you access the file before the new thread has finished executing - maybe look at Thread.Join as well.

      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