summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs')
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs b/Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs
new file mode 100644
index 00000000..1c25c633
--- /dev/null
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs
@@ -0,0 +1,36 @@
+´╗┐using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Controls
+{
+ public partial class LayoutAddPerformance : ContentPage
+ {
+ public LayoutAddPerformance ()
+ {
+ InitializeComponent ();
+ }
+
+ protected override async void OnAppearing ()
+ {
+ base.OnAppearing ();
+
+ layout.Children.Clear ();
+
+ await Task.Delay (2000);
+
+ Stopwatch sw = new Stopwatch();
+ sw.Start ();
+ for (int i = 0; i < 500; i++) {
+ layout.Children.Add (new Label { Text = i.ToString () });
+ }
+ sw.Stop ();
+ this.timingLabel.Text = sw.ElapsedMilliseconds.ToString ();
+ }
+ }
+}