ADAM'S WEB PRESENCE

21 July 2008

Linux Equivalent of the Windows GetTickCount() function

Filed under: Nerd Notes — adam @ 4:08 pm

GetTickCount() is a real handy function in Windows but does not exist in Linux. This code will give a similar result:

#include <sys/time.h>

unsigned GetTickCount()
{
        struct timeval tv;
        if(gettimeofday(&tv, NULL) != 0)
                return 0;

        return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}

14 July 2008

Gravatar support

Filed under: General — adam @ 10:54 am

Just a quick note that this site now supports Gravatars. So if you make a comment here and are registered over at www.gravatar.com, your picture will appear next to your comment like magic!


Powered by WordPress