wowo 13 Report post Posted March 12, 2017 Hi guys, I have to check time taken to open the application (one is on c# and another is written on c++), how can I do so? Thanks in advance. Quote Share this post Link to post Share on other sites
Simon 76 Report post Posted March 12, 2017 50 minutes ago, wowo said: Hi guys, I have to check time taken to open the application (one is on c# and another is written on c++), how can I do so? Thanks in advance. You must have put before a timer on your C# and C++ application so it become possible. Quote Share this post Link to post Share on other sites
Snre3n 94 Report post Posted March 12, 2017 C++ #include <iostream> #include <time.h> // header for clock() #include <windows.h> // header for sleep() using namespace std; int main() { // Start the timer in the top of main() or winMain() clock_t t = clock(); /*Code block with all code that the program has to run before starting*/ Sleep(5000); /*End of code block*/ // Get the time taken to start t = clock() - t; cout << "Time taken to start in seconds: " << ((float)t) / CLOCKS_PER_SEC << endl; return 0; } I hope this is what you were looking for. 2 Quote Share this post Link to post Share on other sites
wowo 13 Report post Posted March 12, 2017 6 minutes ago, Snre3n said: C++ #include <iostream> #include <time.h> // header for clock() #include <windows.h> // header for sleep() using namespace std; int main() { // Start the timer in the top of main() or winMain() clock_t t = clock(); /*Code block with all code that the program has to run before starting*/ Sleep(5000); /*End of code block*/ // Get the time taken to start t = clock() - t; cout << "Time taken to start in seconds: " << ((float)t) / CLOCKS_PER_SEC << endl; return 0; } I hope this is what you were looking for. Thank you, will check it out today. Quote Share this post Link to post Share on other sites