來源: https://github.com/AvaloniaUI/Avalonia/discussions/13697
2024-3-9 實測可用
1 public MainWindow() 2 { 3 InitializeComponent(); 4 RequestAnimationFrame(Tick); 5 } 6 7 public void Tick(TimeSpan time) // total elapsed time, not frame time 8 { 9 textBlock.Text = time.TotalMilliseconds.ToString(); 10 RequestAnimationFrame(Tick); 11 }