質問編集履歴
5
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -81,6 +81,8 @@
|
|
81
81
|
counter += 1
|
82
82
|
|
83
83
|
textFile = New IO.StreamWriter(csvname, True, System.Text.Encoding.Default)
|
84
|
+
|
85
|
+
'ストップウォッチのミリカウントとカウンターを出力
|
84
86
|
|
85
87
|
textFile.WriteLine(sw.ElapsedMilliseconds.ToString & "," & counter.ToString)
|
86
88
|
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -144,7 +144,7 @@
|
|
144
144
|
|
145
145
|
|
146
146
|
|
147
|
-
|
147
|
+
```VB.NET
|
148
148
|
|
149
149
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
150
150
|
|
@@ -193,3 +193,5 @@
|
|
193
193
|
Next
|
194
194
|
|
195
195
|
End Sub
|
196
|
+
|
197
|
+
```
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,21 +72,25 @@
|
|
72
72
|
|
73
73
|
End If
|
74
74
|
|
75
|
+
'1秒経過すると、csvに出力して、ストップウォッチをリスタート
|
76
|
+
|
75
77
|
If sw.ElapsedMilliseconds > 1000 Then
|
76
78
|
|
77
|
-
sw.Stop()
|
79
|
+
sw.Stop()
|
78
80
|
|
79
|
-
counter += 1
|
81
|
+
counter += 1
|
80
82
|
|
81
|
-
textFile = New IO.StreamWriter(csvname, True, System.Text.Encoding.Default)
|
83
|
+
textFile = New IO.StreamWriter(csvname, True, System.Text.Encoding.Default)
|
82
84
|
|
83
|
-
textFile.WriteLine(sw.ElapsedMilliseconds.ToString & "," & counter.ToString)
|
85
|
+
textFile.WriteLine(sw.ElapsedMilliseconds.ToString & "," & counter.ToString)
|
84
86
|
|
85
|
-
textFile.Close() ' -- StreamWriter を閉じて
|
87
|
+
textFile.Close() ' -- StreamWriter を閉じて
|
86
88
|
|
87
|
-
textFile.Dispose() ' -- StreamWriter を解放
|
89
|
+
textFile.Dispose() ' -- StreamWriter を解放
|
88
90
|
|
89
|
-
sw.Restart()
|
91
|
+
sw.Restart()
|
92
|
+
|
93
|
+
End If
|
90
94
|
|
91
95
|
My.Application.DoEvents()
|
92
96
|
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -71,6 +71,22 @@
|
|
71
71
|
Label1.Text = sw.ElapsedMilliseconds.ToString
|
72
72
|
|
73
73
|
End If
|
74
|
+
|
75
|
+
If sw.ElapsedMilliseconds > 1000 Then
|
76
|
+
|
77
|
+
sw.Stop()
|
78
|
+
|
79
|
+
counter += 1
|
80
|
+
|
81
|
+
textFile = New IO.StreamWriter(csvname, True, System.Text.Encoding.Default)
|
82
|
+
|
83
|
+
textFile.WriteLine(sw.ElapsedMilliseconds.ToString & "," & counter.ToString)
|
84
|
+
|
85
|
+
textFile.Close() ' -- StreamWriter を閉じて
|
86
|
+
|
87
|
+
textFile.Dispose() ' -- StreamWriter を解放
|
88
|
+
|
89
|
+
sw.Restart()
|
74
90
|
|
75
91
|
My.Application.DoEvents()
|
76
92
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,7 +32,13 @@
|
|
32
32
|
|
33
33
|
###該当のソースコード
|
34
34
|
|
35
|
+
```VB.NET
|
36
|
+
|
37
|
+
|
38
|
+
|
35
39
|
Dim sw As New Stopwatch()
|
40
|
+
|
41
|
+
'ストップウォッチスタート
|
36
42
|
|
37
43
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
38
44
|
|
@@ -44,7 +50,9 @@
|
|
44
50
|
|
45
51
|
End Sub
|
46
52
|
|
53
|
+
|
47
54
|
|
55
|
+
'ストップウォッチのミリ秒の表示
|
48
56
|
|
49
57
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
50
58
|
|
@@ -58,7 +66,7 @@
|
|
58
66
|
|
59
67
|
If sw.ElapsedMilliseconds > 200 Then
|
60
68
|
|
61
|
-
|
69
|
+
'フォームに出力
|
62
70
|
|
63
71
|
Label1.Text = sw.ElapsedMilliseconds.ToString
|
64
72
|
|
@@ -74,6 +82,8 @@
|
|
74
82
|
|
75
83
|
|
76
84
|
|
85
|
+
'ストップウォッチのリスタート
|
86
|
+
|
77
87
|
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
78
88
|
|
79
89
|
|
@@ -83,6 +93,8 @@
|
|
83
93
|
sw.Restart()
|
84
94
|
|
85
95
|
End Sub
|
96
|
+
|
97
|
+
```
|
86
98
|
|
87
99
|
###試したこと
|
88
100
|
|