Professional Documents
Culture Documents
WWW - Kutub.info 1031
WWW - Kutub.info 1031
com
Microsoft
.net
02
*
MSDN
Microsoft .Net
: ) (
.
3 .I .II .III .
.
/ /
-
28 1428
2007/07/14
2007
System.Diagnostics
Stopwatch
.1
.2
.3
.4
.5
.6
Stopwatch
Stopwatch
-
- )(Methods
- )(Properties
- Visual Basic .NET
.4 .1. : For For Each
.4 .2. : String
StringBuilder
- Visual C#
.4 .1. : for foreach
.4 .2. : String
StringBuilder
.NET!!!
Performance
.net 2.0
03
I
System.Diagnostics
.net 2.0
Stopwatch
.1
.2
Stopwatch
.NET Microsoft Framework .NET 2.0
.
Microsoft Framework .Net
Stopwatch System.Diagnostics
) 7-10 ( 3 !
.2
.
1
2
3
4
:
)(.Reset
)( Start .
)( Stop .
Elapsed ElapsedMilliseconds .ElapsedTicks
.2 .
)(Methods
.
)
)(Reset
) 0 ( Nothing null- . (ElapsedXXX
.
)(Start
.ElapsedXXX
IsRunning .false
)(Stop
:1.2 .Stopwatch
ElapsedXXX : Elapsed ElapsedTicks
ElapsedMilliseconds
Performance
) (Debugging
.
.
04
System.Diagnostics
Performance
.net 2.0
05
Stopwatch
Stop() Start()
.TimeSpan
710) 100) Ticks
( Tick 1 = (
.
.
( Properties) '()*+
..2
System.TimeSpan
Elapsed
System.Int64
ElapsedTicks
System.Int64
ElapsedMilliseconds
System.Boolean
IsRunning
Stopwatch :2.2
:C<
D)EF GHI 2 K<
LH ..3
Private Function Concat(ByRef Target As String, ByVal newChar As
Char, ByVal nb As Integer) As Boolean 'VB .NET * +,If nb <= 0 Then
Return False
Else
Dim i As Integer
For i = 1 To nb
Target &= newChar
Next
Return True
End If
End Function
//C# * +,private bool Concat (ref string Target,char newChar,int nb)
{
if (nb <= 0)
return false;
else
{
for (int i = 0; i < nb; i++)
Target += newChar;
return true;
}
}
. :1.3
Performance
.net 2.0
06
System.Diagnostics
Stopwatch
*UTF
. 50000 :2.3
T<
GU4@ VHI .4
for) For Each For
StringBuilder String ( C# foreach
.Visual C# Visual Basic .NET
:
) ( . JIT MSIL
.
)
.(
System.Text StringBuilder -
System.Diagnostics
.net 2.0
Stopwatch
Performance
07
. :1.4
.net 2.0
System.Diagnostics
Stopwatch
Performance
08
. 50000 :2.4
:2.4
StringBuilder
System.Diagnostics
.net 2.0
Stopwatch
Performance
Visual C# K4T
..4
09
. C# .1..4 :3.4
System.Diagnostics
.net 2.0
Stopwatch
Performance
10
. C# .2..4 :3.4
System.Diagnostics
.net 2.0
Stopwatch
)4 .5
c 4T
2 )e2
27C<
T
` 8!!!
Performance
11
*/
*+, C++YD Grd~F GD windows.h :header
*/
"#include "windows.h
:
1 .long
2 .long
3 )
(.
)i .6
Stopwatch
.NET Framework 2.0
.
.
.
2007