I am trying to use a timer library that I created my self, it uses clock_t in it. When I compile the sketch i keep getting errors. This is the error I keep getting error: 'clock_t' in namespace 'std' does not name a type.
Is it even possible to use clock_t. The library I wrote worked perfectly on a c++ compiler, but not here.
I am new to this Arduino stuff, any help will be nice. Thanks in advance.
Arduino links against AVR Libc, and most of the things that look similar to C standard library come from it.
As far as I know, there is no
clock_tin AVR Libc. I searched among the source files of the library, and looked around the documentations, but didn’t find it. There is notime.hin AVR Libc, either.And according to Arduino FAQ:
And in AVR-libc FAQ:
So, Arduino doesn’t provide C++ standard library for you – so
ctime(C++) is not available as well astime.h(C). That’s to say, most likely you cannot useclock_tin Arduino environment.