Advertisement
zolffik

btnTest1.xaml.cs

May 1st, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Navigation;
  8. using Microsoft.Phone.Controls;
  9. using Microsoft.Phone.Shell;
  10. using System.Diagnostics;
  11. using System.Threading;
  12.  
  13. namespace testy_wp
  14. {
  15.     public partial class Test1 : PhoneApplicationPage
  16.     {
  17.         public Test1()
  18.         {
  19.             Stopwatch stopwatch = new Stopwatch();
  20.             stopwatch.Start();
  21.             double pi = 0;
  22.             for (int i = 1; i < 1000000000; i += 4)
  23.             {
  24.                 pi += 8.0 / (i * (i + 2L));
  25.             }
  26.             stopwatch.Stop();
  27.             WynikTest1.Text = (pi + stopwatch.Elapsed.TotalMilliseconds.ToString()  + " zajęło  ");
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement