Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

rand() warmup

Name: Anonymous 2012-01-20 16:28

void init_random() {
    clock_t start = clock();
    int i = 0;
    while (clock() - start == 0) {
        i++;
    }
    srand(time(0) + i);
}


17±3 ms
Is it okay?

Name: Anonymous 2012-01-20 17:37


int fd  = open('/dev/random', O_RDONLY);
int num; read(fd, &num, sizeof(num);


PROFESSIONAL PROGRAMMING SOLUTION

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List