close


------------------------------------------------------------------
Method 1
------------------------------------------------------------------
'測量己耗用的時間
Dim Watch As New Stopwatch

Watch.Start()
'程式內容
Watch.Stop()
Dim i As Integer = Watch.ElapsedMilliseconds / 1000
Watch.Reset()

------------------------------------------------------------------
Method 2
------------------------------------------------------------------
Dim t1 As DateTime = DateTime.Now
'程式內容
Dim t2 As DateTime = DateTime.Now
MessageBox.Show("總共花費:" & t2.Subtract(t1).TotalSeconds & "秒")
------------------------------------------------------------------

資料來源:程式設計俱樂部
http://tinyurl.com/3af8su

arrow
arrow
    全站熱搜

    dark99 發表在 痞客邦 留言(0) 人氣()