What is the most efficient way of getting current time/date/day/year in C language? As I have to execute this many times, I need a real efficient way. I am on freeBSD.
thanks in advance.
Standard C provides only one way to get the time - time()
- which can be converted to a time/date/year with localtime()
or gmtime()
. So trivially, that must be the most efficient way.
Any other methods are operating-system specific, and you haven't told us what operating system you're using.