If this is in template code then you can just check the type at compile
time, like
if constexpr( not is_same_v<T, chrono::steady_clock> ) {
Possibly you may have to remove reference and cv-qualification of T.
Ref. <url:
https://en.cppreference.com/w/cpp/types/is_same>
---
Not what you're asking, but the code essentially says that only if type
T is not a steady_clock do you want to output the end time, and in that
case you're sure that type T has a to_time_t static member function, and
that's all quite baffling to me.
I would think about ways to reorganize that so that it doesn't depend so
much on the details of the (unspecified) context.
Because: as general habit that makes it easier to change things in code
without having to worry about that a piece of it here or there might
stop working because it depended on a contextual detail.
- Alf