.net - How to measure the time an application takes to start up in C#? -
i have gui application takes while load plugins, before ready used user.
i want write c# program measure time taken application start up. thought process.waitforinputidle() method trick, doesn't. exits process started.
what have this:
datetime starttime = datetime.now; process myappundertest = process.start("c:\\program files\\my app\app_under_test.ext"); myappundertest.waitforinputidle(); //wait until application idle. datetime endtime = datetime.now; int elapsedtimeinsecs = endtime.subtract(starttime).seconds; console.writeline("start time (sec): {0}", elapsedtimeinsecs);
how can start time intend?
i it's difficult.
how classify application loaded , ready? if there way (which don't think so) easy.
but if app loading signals in way (ipc/files/network), can capture signal , app loaded. in case, can use timer/stopwatch/performance counter.
if can modify timed app, can achieve in various ways. if external you, doubt there easy way.
Comments
Post a Comment