Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Threading;
- using System.Diagnostics;
- namespace vrijemeOgranicenje
- {
- class Program
- {
- static void Ispisi()
- {
- int m = 1;
- Console.WriteLine("Ispisujem ovo {0}. put", m);
- m++;
- }
- static void Main(string[] args)
- {
- Stopwatch stoperica = new Stopwatch();
- TimeSpan ogranicenje = new TimeSpan(0,0,0,0,30000);
- stoperica.Start();
- while (stoperica.ElapsedMilliseconds < ogranicenje.TotalMilliseconds)
- {
- Thread th = new Thread(Ispisi);
- th.Start();
- th.Join();
- }
- stoperica.Stop();
- Console.WriteLine("Vrijeme isteklo");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement