Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Timer2 v.1
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Timers; namespace Rextester { class Program { static TimeSpan t1 = TimeSpan.FromMilliseconds(20); static DateTime t2_now; static TimeSpan t3_temp = TimeSpan.FromMilliseconds(0); static int count = 0; public static void Main(string[] args) { //Thread myThread = new Thread(func); //Создаем новый объект потока (Thread) t2_now = DateTime.Now; // myThread.Start(); //запускаем поток /*for (int i = 0; i < 10; i++ ) { // Console.WriteLine("Поток 1 выводит " + t1 + " t2_now = " + t2_now.Millisecond); Thread.Sleep(0); }*/ do { t3_temp += TimeSpan.FromMilliseconds(10) ; if (t3_temp> t1) {Console.WriteLine("Внутри while 1: " + t3_temp + " t1 = " + t1 + " | "); t3_temp = TimeSpan.FromMilliseconds(0); Console.WriteLine("Внутри while 2: " + t3_temp + " t1 = " + t1); } count++; Console.WriteLine(" count = " + count); }while (count < 50); Console.Read(); //Приостановим основной поток } /* static void func() { for (int i = 0; i < 10; i++) { // Console.WriteLine("Поток 2 выводит " + i.ToString()); Thread.Sleep(0); } }*/ } }
run
|
edit
|
history
|
help
0
Fibonacci recursion
ö1
ICollection<T>.Add(T) - Performance Test
Game v 1.0
regex
Fórum ➡ What values have the greatest frequency? ♦
triangular matrix
Palindrome 2
ruSrib
Uri Parts