/* Eli Fulkerson, June 2005. http://www.elifulkerson.com for updates. */ /* License: Do whatever you want with this without restriction. Its too trivial to bother fighting over. That being said, I'd love to hear feedback if you find it useful, and appreciate being given credit if you feel like it. */ #include #include #include int main(int argc, char *argv[]) { /* very primitive argument checking. We only have one argument, which is our prefix */ if (argc < 1 || !argv[1]) { printf("Usage: sleep [milliseconds]\n"); printf(" ...where [seconds] is a desired number of milliseconds.\n"); printf(" ...for the math challenged... 'millisleep 1000' will sleep for\n"); printf(" one second. Not guaranteed to be real time, it really depends\n"); printf(" on the OS whether the precision is correct when measuring small\n"); printf(" periods of time.\n"); printf("\n"); printf("(millisleep.exe by Eli Fulkerson. http://www.elifulkerson.com for updates.)\n"); return 1; } int ms; ms = atoi(argv[1]); printf("Sleeping for %d milliseconds.\n", ms); Sleep(ms); return 0; }