Time Elapsed or Response Time Results always Up / Grow Up make it stable

佐手、 提交于 2019-12-25 09:15:53

问题


in Posting Before : I want to get response time on a simple math value if "button calculate" press, get sum value a and value b in textbox and also show how long to proceed that math calculation (response time) in textbox.

BUT why my result always grow up / always up like in picture how to make result stable and less volatile ?

the result when i click calculate button on a continuous

picture

coding button calculate

Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
    Dim sw = New System.Diagnostics.Stopwatch()
    sw.Start()

    Timer1.Start()
    Me.stopwatch.Start()
    TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
    ListBox1.Items.Add(TextBox4.Text)

    sw.Stop()
    ' time is a timespan that represents the time passed between sw.Start() and sw.Stop().
    TextBox4.Text = (sw.Elapsed.TotalMilliseconds.ToString())
    sw.Reset() End Sub

来源:https://stackoverflow.com/questions/41817694/time-elapsed-or-response-time-results-always-up-grow-up-make-it-stable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!