Skip to content

Instantly share code, notes, and snippets.

@jes
Created March 28, 2019 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jes/750f644ac79b4875b4b4dc0464cdd05d to your computer and use it in GitHub Desktop.
Save jes/750f644ac79b4875b4b4dc0464cdd05d to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
int main() {
srand(time(NULL));
short *buf = malloc(1048576);
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1048576/sizeof(short); j++) {
buf[j] = rand();
}
write(1, buf, 1048576);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment