
"Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr> wrote in news:4ED49A27.2030500@wanadoo.fr:
Glad to hear you are considering it. Have you any measures that let you think there is a serious overhead? How do you use the ::now() function to make your performance measures?
Thanks for the feedback. A typical use case: const time_point startTime = steady_clock::now(); // stuff to measure here const time_point endTime = steady_clock::now(); const duration elapsed = endTime - startTime; Ideally the conversion from ticks to nanoseconds would be done by the subtraction operator. Another use case, waiting a precise amount of time: void wait(const duration timeToWait) { const time_point endTime = steady_clock::now() + timeToWait; while (steady_clock::now() < endTime) ; } Here, the conversion from nanoseconds to ticks would be done by the addition operator, so that the time_point comparison would be in ticks. I'd use this where I need to wait a small amount of time (much less than a scheduler tick) for a hardware device to respond, before giving up my time slice.