Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A few questions
#3
WPF starts slowly. Only the first WPF window in that process; other windows are faster. On most computers the first window should start in less than 1 s.
 
Code:
Copy      Help
// script ""
using System.Windows;
using System.Windows.Controls;

//This script measures the time needed to show a WPF window.

for (int i = 0; i < 2; i++) {
    perf.first();
    timer.after(1, _ => { perf.nw(); }); //when the window is fully loaded, visible and ready for input
    ShowWpfWindow();
    1.s();
}


void ShowWpfWindow() {
    var w = new Window { Title = "WPF window" };
    w.Content = new TextBox();
    w.ShowDialog();
}


//On my new Win11 computer: first time 300 ms, then 45 ms.
//On my old (year 2014) Win10 computer: first time 600 ms, then 50 ms. After long time first time can be 1.8 s.


Messages In This Thread
A few questions - by marktech - 12-10-2022, 08:13 PM
RE: A few questions - by Gintaras - 12-11-2022, 12:16 PM
RE: A few questions - by Gintaras - 12-11-2022, 12:17 PM
RE: A few questions - by marktech - 12-11-2022, 01:14 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)