Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Stopwatch timer = new Stopwatch();
- timer.Start();
- for (int i = 0; i < 1000000; i++)
- {
- if ((i & 1) == 0)
- {
- //Console.WriteLine(i);
- }
- else
- {
- //Console.WriteLine(-i);
- }
- }
- timer.Stop();
- Console.WriteLine(timer.Elapsed);
- timer.Reset();
- timer.Start();
- for (int i = 0; i < 1000000; i++)
- {
- if (i % 2 == 0)
- {
- //Console.WriteLine(i);
- }
- else
- {
- //Console.WriteLine(-i);
- }
- }
- timer.Stop();
- Console.WriteLine(timer.Elapsed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement