How show minutes and seconds with Stopwatch()

前端 未结 7 470
北荒
北荒 2021-02-01 12:20

I need to show also the minutes, actually I use this code for show the seconds, but also need the minutes

TimeSpan ts = stopwatch.Elapsed;
Console.WriteLine(\"F         


        
7条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 13:02

    TimeTakenOutput.Text = "0" + myStopWatch.Elapsed.Minutes.ToString() 
     + ":" + myStopWatch.Elapsed.Seconds.ToString() + "mins";
    

提交回复
热议问题