#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main() {
int buflen = 1 << 20;
FILE
* pf
= fopen("/dev/null", "w"); clock_t start;
int i;
unsigned long long int written = 0;
while (((float)(clock() - start
)) / CLOCKS_PER_SEC
< 0.95) { for (i = 0; i < 1000; ++i) {
written
+= fwrite(buf
, 1, buflen
, pf
); }
}
printf("time taken: %fs, bytes written: %llu\n", ((float)(clock() - start
)) / CLOCKS_PER_SEC
, written
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8dGltZS5oPgoKaW50IG1haW4oKSB7CiAgICBpbnQgYnVmbGVuID0gMSA8PCAyMDsKICAgIGNoYXIqIGJ1ZiA9IG1hbGxvYyhidWZsZW4pOwogICAgRklMRSogcGYgPSBmb3BlbigiL2Rldi9udWxsIiwgInciKTsKICAgIGNsb2NrX3Qgc3RhcnQ7CiAgICBpbnQgaTsKICAgIHVuc2lnbmVkIGxvbmcgbG9uZyBpbnQgd3JpdHRlbiA9IDA7CiAgICBtZW1zZXQoYnVmLCAwLCBidWZsZW4pOwogICAgc3RhcnQgPSBjbG9jaygpOwogICAgd2hpbGUgKCgoZmxvYXQpKGNsb2NrKCkgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUMgPCAwLjk1KSB7CiAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwMDA7ICsraSkgewogICAgICAgICAgICB3cml0dGVuICs9IGZ3cml0ZShidWYsIDEsIGJ1ZmxlbiwgcGYpOwogICAgICAgIH0KICAgIH0KICAgIGZjbG9zZShwZik7CiAgICBmcmVlKGJ1Zik7CiAgICBwcmludGYoInRpbWUgdGFrZW46ICVmcywgYnl0ZXMgd3JpdHRlbjogJWxsdVxuIiwKICAgICAgICAoKGZsb2F0KShjbG9jaygpIC0gc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDLCB3cml0dGVuKTsKICAgIHJldHVybiAwOwp9Cg==