hello everyone , i have a code for selection sort and i wanna modify it to give me a running time , any help?

You can get the current Unix time here:

https://en.cppreference.com/w/cpp/chrono/c/time

That should give you the number of seconds since 1-1-1970. Just take the number at the beginning of the code, take the number at the end of the code, and the difference is how many seconds your script took to run.

Oh, also, when it says on the page I linked to time since epoch, that’s the same as Unix time, which is the same as a counter of seconds elapsed since 1-1-1970.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.