TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
venus najad
1.3k
414
27.6k
how to make outer while loop runs slower than the inner one
Mar 3 2019 10:10 AM
hello... i need help with making my outer whileloop runs slower than the inner while loop...
to make them that both runs at the same moment, i have used continue method...
but when i compile, the inner loop runs with the same rate as outer one...i have used thread.sleep(1000) for outer loop and thread.sleep(1) for inner loop... when i compile, the innner loop goes each second instead of each milisecond.. my continue make the inner loop dependent on outer loop... appreciate any help...
the codes are:
while
(t ==
true
)
{
try
{
cd.TimeTick();
//tick time
lblTime.Text = cd.GetTime();
//put time
Thread.Sleep(1000);
//delay with one second
Application.DoEvents();
while
(tLu ==
true
)
{
try
{
cdLu.TimeTick();
//tick time
lblLunch.Text = cdLu.GetTime();
//put time
Thread.Sleep(1);
//delay with one milisecond
Application.DoEvents();
throw
new
Exception();
}
catch
(Exception)
{
throw
new
Continue();
}
}
[Serializable]
internal
class
Continue : Exception
{
public
Continue()
{
}
public
Continue(
string
message) :
base
(message)
{
}
public
Continue(
string
message, Exception innerException) :
base
(message, innerException)
{
}
protected
Continue(SerializationInfo info, StreamingContext context) :
base
(info, context)
{
}
}
Reply
Answers (
8
)
Empty Cell Double Click
How to read gmails of all users in same domain using imperso