timer and random bytes api