Reputation:
Quoting man 3 ftime
:
This function is obsolete. Don't use it. If the time in seconds suffices, time(2) can be used; gettimeofday(2) gives microseconds; clock_gettime(2) gives nanoseconds but is not as widely available.
Why should it not be used? What are the perils?
I understand that time(2)
, gettimeofday(2)
and clock_gettime(2)
can be used instead of ftime(3)
, but ftime(3)
gives out exactly milliseconds, and this I find convenient, since milliseconds is the exact precision I need.
Upvotes: 0
Views: 673
Reputation: 215193
Such advice is intended to help you make your program portable and avoid various pitfalls. While the ftime
function likely won't be removed from systems that have it, new systems your software gets ported to might not have it, and you may run into problems, e.g. if the system model of time zone evolves to something not conveniently expressible in the format of ftime
's structure.
Upvotes: 1