Re: side-effect-free function

2021-03-09 Thread Martin Sebor via Gcc
On 3/9/21 8:05 AM, Rasmus Villemoes via Gcc wrote: Hi, Consider some function now() which returns some kind of "current timestamp" as a simple scalar. It could be a wrapper for clock_gettime(CLOCK_MONOTONIC) which converts the timespec value to nanoseconds, or in the linux kernel one of the ktim

side-effect-free function

2021-03-09 Thread Rasmus Villemoes via Gcc
Hi, Consider some function now() which returns some kind of "current timestamp" as a simple scalar. It could be a wrapper for clock_gettime(CLOCK_MONOTONIC) which converts the timespec value to nanoseconds, or in the linux kernel one of the ktime_get* family. Then consider code like start = now(