Fix datetime function for generating IDs

Running into ID collision using the gettime() method for trying to generate unique IDs on an Intel I7. Instead why not just use a counter to ensure all the IDs are unique?