R
Ram Prasad
Hello,
I am pretty much inexperienced in C, I have used perl etc but
obvioulsy when It comes to efficiency I have to turn to C
Currenlty trying to write a patch in to my current uucp systems to
implement ratelimits.
For this I need to get-current-hour. Probably thousands of times in
an hour.
What will be the best way of doing so. If have written this code .. is
it ok enough ?
----------
#include <time.h>
#include <stdio.h>
int main (void)
{
struct tm *ts;
time_t mytime = time(0);
ts = localtime(&mytime);
printf("Current Hour is %d\n",ts->tm_hour); /* print is just for
the sample code .. */
return 0;
}
-----------
I am pretty much inexperienced in C, I have used perl etc but
obvioulsy when It comes to efficiency I have to turn to C
Currenlty trying to write a patch in to my current uucp systems to
implement ratelimits.
For this I need to get-current-hour. Probably thousands of times in
an hour.
What will be the best way of doing so. If have written this code .. is
it ok enough ?
----------
#include <time.h>
#include <stdio.h>
int main (void)
{
struct tm *ts;
time_t mytime = time(0);
ts = localtime(&mytime);
printf("Current Hour is %d\n",ts->tm_hour); /* print is just for
the sample code .. */
return 0;
}
-----------