t_start = std::chrono::high_resolution_clock::now();
t_end = std::chrono::high_resolution_clock::now();
long t = t_start; //error
Furthermore, I cannot add t_start with t_end.
t_start += t_end; //error
t_start = std::chrono::high_resolution_clock::now();
t_end = std::chrono::high_resolution_clock::now();
long t = t_start; //error
Furthermore, I cannot add t_start with t_end.
t_start += t_end; //error
It doesn't make sense to add two time points, one operand should be a duration. Consider the following sentences:
Add "1523439002.733219701 seconds since 1 Jan 1970" to "1523439842.733219701 seconds since 1 Jan 1970"
Add "500 seconds" to "523439842.733219701 seconds since 1 Jan 1970"
Add "523439842.733219701 seconds since 1 Jan 1970" to "500 seconds"
Add "500 seconds" to "1000 seconds"
From your comments, what you actually want is to pass time points around. Just change the code that accepts long
s to accept std::chrono::high_resolution_clock::time_point
s