#include #include #include #include int main(void) { int val=0; int arr[1000000] = {0}; int filedesc = open("/media/nvme/test.raw", O_WRONLY); clock_t t; if (filedesc < 0) { return -1; } t = clock(); while(val < 256) { write(filedesc, arr, sizeof(arr)); val++; } t = clock() -t; double time_taken = ((double)t)/CLOCKS_PER_SEC; printf("fun() took %f seconds to execute \n", time_taken); close(filedesc); return 0; }