Skip to content

Instantly share code, notes, and snippets.

@jadudm
Last active August 29, 2015 14:07
Show Gist options
  • Save jadudm/3b9187a0f9277364164d to your computer and use it in GitHub Desktop.
Save jadudm/3b9187a0f9277364164d to your computer and use it in GitHub Desktop.
A simple loop...
#include <stdio.h>
/* Provides a way to sleep for microseconds */
#include <unistd.h>
/* But, I want MILLIseconds... */
#define MILLIS 1000
/* Like this:
usleep(500 * MILLIS);
*/
int main () {
for (int i = 0; i < 256; i++) {
printf ("%d\n", i);
}
}
all:
gcc -o demo -std=gnu99 demo.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment