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();
- lblTime.Text = cd.GetTime();
- Thread.Sleep(1000);
- Application.DoEvents();
- while (tLu == true)
- {
- try {
- cdLu.TimeTick();
- lblLunch.Text = cdLu.GetTime();
- Thread.Sleep(1);
- 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)
- {
- }
- }