Advertisement
Guest User

Untitled

a guest
May 29th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2.  
  3. namespace meditationInterface
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             DateTime s, f = new DateTime();
  10.             TimeSpan part, all = new TimeSpan();
  11.             TimeSpan avg = new TimeSpan();
  12.             int count = 0;
  13.             Console.WriteLine("Press any key to start");
  14.             Console.ReadKey();
  15.             Console.WriteLine("Started!");
  16.             Console.WriteLine("--------------------------------------------");
  17.             while (true)
  18.             {
  19.                 s = DateTime.Now;
  20.                 Console.ReadKey();
  21.                 f = DateTime.Now;
  22.                 part = f.Subtract(s);
  23.                 all += part;
  24.                 count++;
  25.                 avg = all / count;
  26.                 Console.WriteLine("--------------------------------------------");
  27.                 Console.Write("This part: ");
  28.                 Console.WriteLine( part);
  29.                 Console.Write("Distractions: ");
  30.                 Console.WriteLine(count);
  31.                 Console.Write("Äverage part length: ");
  32.                 Console.WriteLine(avg);
  33.                 Console.WriteLine("--------------------------------------------");
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement