Firstly, why aren't you using a counter? Usually that's all you need.
Secondly, you should use uuids rather than timestamps. They've solved this problem, and there is no really no good reason for you to try to solve it yourself, potentially opening yourself up to problems.
Thirdly, the calculation you should do is called the birthday problem. The original birthday problem asks how likely it is that two people in a group share a birthday. It should be clear this is pretty much the same as asking how likely it is that two timestamps where generated at the same millisecond (or whatever granularity).
As it turns out, you only need 23 people for the probability of a shared birthday to exceed 50%. This is much less than most people expect (hence sometimes being called the birthday paradox). It's also why there's a good chance that collisions are more likely than you are expecting.
You can read about how to compute it on Wikipedia or use the online calculator at WolfromAlpha:
Just to give an example, if you generate 10 ids a second with a granularity of milliseconds, the probability of a collision is 1 in 23. On average, you'll have a collision every 23 seconds.
But it's worse than that. The assumption in this math is that every possible birthday is equally likely. That's not true for birthdays, more people on born in the spring. It's also not going to be true for your timestamps. You are going to get much heavier on certain times of the day than others.
What's worst of all, is that a sudden increase of usage, resulting in a large increase of the chance of collisions is exactly the time you don't want a mysterious random failure like will result.
Don't use timestamps. Just don't. Use uuids which have been engineered by smart people to avoid the collision problem.