All pastes #1509984 Raw Edit

Something

public c v1 · immutable
#1509984 ·published 2009-07-28 13:54 UTC
rendered paste body
#include<stdio.h>#include<stdlib.h>#include<time.h>#include<sys/types.h>#include<sys/stat.h>#include<unistd.h>int main (int argc,char **argv) {		int a,b,c;		FILE *f;		struct timeval cs,ce;		struct stat m_stat;		char *mfile = "myfile.txt";		f = fopen(mfile,"r");		for(b=c=0;c<200;c++) {		gettimeofday(&cs,NULL);		a = fseek(f,-1,SEEK_END);		gettimeofday(&ce,NULL);		b += ce.tv_usec - cs.tv_usec;		}		printf("my avg fseek:%d\n", (b/200));		for(b=c=0;c<200;c++) {		gettimeofday(&cs,NULL);		a = fstat(fileno(f),&m_stat);		gettimeofday(&ce,NULL);		b += ce.tv_usec - cs.tv_usec;		}		printf("my avg fstat:%d\n", (b/200));		fclose(f);}