Well, the random generator is very simple. For each second passed, the seed seems to grow exactly by one. Second, %d is for integers, not for time_ts. It might not be _very_ portable. The new scope.. I can't tell whether it's a good idea or not. It probably is. The algorithm is fine, as I'm using it, too.