Questions tagged [thread-sleep]

The .net Thread.Sleep(...) method suspends the caller for a specified amount of time.

A call to Thread.Sleep(n) has no side effects, and it will not return until at least n milliseconds have elapsed.

References

815 questions
-4
votes
4 answers

How to run one method at a time in java?

Just say I have 4 methods from two different classes.. class1.method1(), class1.method2(), class2.method3(),class2.method4(). method1 will be streaming data to a database which can take a few minutes to execute. method2 will use the data in the…
-4
votes
3 answers

Multithreading in java interrupt()

I am trying to find element using two threads as soon as 1st thread finds the element it will interrupt other thread i have divided the array into 2 parts (0-length/2) & (length/2 -n) to search over it. But I am not able to achieve the…
nlogn
  • 1,034
  • 4
  • 11
  • 17
-4
votes
3 answers

Thread.Sleep(Int32) does not work C#

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace Fuzzy.Test.DateTimeParserTests { class TimeValidationTests { DateTime first =…
Omar.Ebrahim
  • 862
  • 1
  • 10
  • 30
-4
votes
1 answer

Synchronous method vs Thread.Sleep()

I can't understand the difference between Thread.Sleep() and synchronous methods. Please explain.. Is synchronous method in C# is similar to Thread.Sleep()?.
-6
votes
1 answer

How to set timeout in C#

I would like to ask how to do it in my console application in C# to program must wait 3 seconds. For example, the program displays the line Console.WriteLine("Hello!"); the program then wait 3 seconds and then writes the next line:…
Ronte
  • 9
  • 1
  • 1
  • 3
1 2 3
54
55