-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
69 lines (64 loc) · 2.23 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using AMD_test;
namespace AMD_test
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent ();
}
private void Test_Click(object sender, RoutedEventArgs e)
{
test.IsEnabled = false;
lb.Items.Clear ();
Application.Current.Dispatcher.Invoke (DispatcherPriority.Background, new Action (delegate { }));
DateTime dt1 = DateTime.Now;
DateTime dt2;
//
// run test 5 times
//
for (int i = 0; i < 5; ++i) {
//
// stage1
//
XReflection.Init1 ();
dt2 = DateTime.Now;
lb.Items.Add (string.Format ("{0} Init1 : duration {1}", i, (dt2 - dt1).ToString ()));
Application.Current.Dispatcher.Invoke (DispatcherPriority.Background, new Action (delegate { }));
dt1 = dt2;
//
// stage2
//
XReflection.Init2 ();
dt2 = DateTime.Now;
lb.Items.Add (string.Format ("{0} Init2 : duration {1}", i, (dt2 - dt1).ToString ()));
Application.Current.Dispatcher.Invoke (DispatcherPriority.Background, new Action (delegate { }));
dt1 = dt2;
//
// with a Intel System all the times are nearly the same between 1 and 2 seconds
//
// with a AMD Ryzen System after the 3 Run the time for the stage2 rises to nearly 20 seconds
// and rests at this level
//
}
test.IsEnabled = true;
}
}
}