0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
This commit is contained in:
Eliot Horowitz 2009-01-03 13:01:29 -05:00
parent fdb7b856d3
commit 8c35ccfba6

View File

@ -24,12 +24,13 @@ int main(int argc, char* argv[], char *envp[] ) {
fwrite("abc", 3, 1, f);
cout << "small writes: " << t.millis() << "ms" << endl;
}
{
Timer t;
for( int i = 0; i < 50000; i++ ) {
fwrite("abc", 3, 1, f);
fflush(f);
fsync( fileno( f ) );
}
cout << "flush: " << t.millis() << "ms" << endl;
}
@ -39,10 +40,11 @@ int main(int argc, char* argv[], char *envp[] ) {
for( int i = 0; i < 500; i++ ) {
fwrite("abc", 3, 1, f);
fflush(f);
fsync( fileno( f ) );
sleepmillis(10);
}
cout << "flush with 5000 sleep: " << t.millis() << "ms" << endl;
}
return 0;
}