U++ framework
Do not panic. Ask here before giving up.

Home » Community » U++ community news and announcements » usecs
Re: usecs [message #50701 is a reply to message #50699] Thu, 06 December 2018 20:56 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Zbych wrote on Thu, 06 December 2018 20:19
mirek wrote on Thu, 06 December 2018 19:46
A the moment, it seemed like a good solution to use what C++ lib provides.


I strongly disagree.


Yet you are proposing using C++ lib as well Smile

Quote:

My proposition is to use steady_clock for msecs instead:
int msecs(int prev)
{
	auto p2 = std::chrono::steady_clock::now();
	return (int)std::chrono::duration_cast<std::chrono::milliseconds>(p2.time_since_epoch()).count() - prev;
}



Accepted. I think this is a good idea, we just need to remember that msecs is steady and usecs is not. I guess there is little harm that way - we can anticipate the use of msecs to synchronize things like sockets and usecs to benchmark things (and that is notoriously unstable for other reasons too).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Critical issues to resolve for U++ 2018.1 - please suggest
Next Topic: Happy New Year 2019
Goto Forum:
  


Current Time: Fri Oct 23 06:41:29 GMT+2 2026

Total time taken to generate the page: 0.00585 seconds