2021年4月1日星期四

Xamarin Forms Stopwatch Milliseconds Format

I'm using simple stopwatch in xamarin forms, everything is ok but when I use lable to view it, it shows the milliseconds include (7) digits as follows: 00:00:00:0000000

how i can make it less or formatted it as I want?

Stopwatch stopWatch = new Stopwatch();  stopWatch.Start();              Device.StartTimer(TimeSpan.FromMilliseconds(0), () =>              {                  lblText.Text = stopWatch.Elapsed.ToString();                  return true;                  });  
https://stackoverflow.com/questions/66884537/xamarin-forms-stopwatch-milliseconds-format March 31, 2021 at 04:56PM

没有评论:

发表评论