File tree Expand file tree Collapse file tree 1 file changed +0
-37
lines changed
frameworks/keyed/blazor-wasm/src Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,6 @@ namespace blazor_wasm
6
6
{
7
7
public partial class App
8
8
{
9
- string lastMeasure ;
10
- Stopwatch Stopwatch ;
11
-
12
- void StartMeasure ( string name )
13
- {
14
- Stopwatch = Stopwatch . StartNew ( ) ;
15
- lastMeasure = name ;
16
- }
17
-
18
- void StopMeasure ( )
19
- {
20
- Stopwatch . Stop ( ) ;
21
- var last = this . lastMeasure ?? "" ;
22
- if ( ! string . IsNullOrWhiteSpace ( this . lastMeasure ) )
23
- {
24
- lastMeasure = string . Empty ;
25
- Console . WriteLine ( $ "{ last } took { Stopwatch . ElapsedMilliseconds } ms") ;
26
- Stopwatch . Reset ( ) ;
27
- }
28
- }
29
-
30
9
List < Data > data = new List < Data > ( ) ;
31
10
int selected ;
32
11
int id = 1 ;
@@ -64,62 +43,46 @@ List<Data> BuildData(int count = 1000)
64
43
65
44
public void Select ( Data item )
66
45
{
67
- StartMeasure ( "select" ) ;
68
46
this . selected = item . Id ;
69
47
}
70
48
71
49
void Delete ( Data item )
72
50
{
73
- StartMeasure ( "delete" ) ;
74
51
this . data . Remove ( item ) ;
75
52
}
76
53
77
54
void Run ( )
78
55
{
79
- StartMeasure ( "run" ) ;
80
56
this . data = this . BuildData ( ) ;
81
57
}
82
58
void Runlots ( )
83
59
{
84
- StartMeasure ( "runlots" ) ;
85
60
this . data = this . BuildData ( 10000 ) ;
86
61
}
87
62
void Add ( )
88
63
{
89
- StartMeasure ( "add" ) ;
90
64
this . data . AddRange ( this . BuildData ( 1000 ) ) ;
91
65
}
92
66
void Update ( )
93
67
{
94
- StartMeasure ( "update" ) ;
95
68
for ( var i = 0 ; i < this . data . Count ; i += 10 )
96
69
{
97
70
this . data [ i ] . Label += " !!!" ;
98
71
}
99
72
}
100
73
void Clear ( )
101
74
{
102
- StartMeasure ( "clear" ) ;
103
75
this . data = new List < Data > ( ) ;
104
76
this . selected = 0 ;
105
77
}
106
78
void SwapRows ( )
107
79
{
108
- StartMeasure ( "swapRows" ) ;
109
80
if ( this . data . Count > 998 )
110
81
{
111
82
var a = this . data [ 1 ] ;
112
83
this . data [ 1 ] = this . data [ 998 ] ;
113
84
this . data [ 998 ] = a ;
114
85
}
115
86
}
116
-
117
- protected override void OnAfterRender ( bool firstRender )
118
- {
119
- if ( ! firstRender )
120
- {
121
- this . StopMeasure ( ) ;
122
- }
123
- }
124
87
}
125
88
}
You can’t perform that action at this time.
0 commit comments