Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | WP Backend | RSS2 | Atom

« randpassphrase | makecdrfiles »

timeinmicroseconds.c

I wrote this today as a demonstration of where /dev/random gets all its randomness.

/* Copyright 2007 Hal Canary, http://halcanary.org/
Dedicated to the Public Domain. */
#include <stdio.h>
#include <sys/time.h>
int main(void) {
        struct timeval x;
        struct timezone t;
        gettimeofday(&x, &t);
        printf("%u.%06u\n",x.tv_sec,x.tv_usec);
        return(0);
}

And then…

$ cc -o timeinmicroseconds timeinmicroseconds.c
$ while read -s -n 1 x ; do ./timeinmicroseconds ; done

Hal Canary | Computers & Code | 2007-03-22 15:50:15 EDT
Permanent Link | No Comments

Comments are closed.

Copyright 1997-2007 by Hal Canary.
mailto: h3 at halcanary dot org
xmpp:halcanary@jabber.org
aim:halwcanary
http://halcanary.org