mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
fsync
This commit is contained in:
parent
fdb7b856d3
commit
8c35ccfba6
@ -30,6 +30,7 @@ int main(int argc, char* argv[], char *envp[] ) {
|
||||
for( int i = 0; i < 50000; i++ ) {
|
||||
fwrite("abc", 3, 1, f);
|
||||
fflush(f);
|
||||
fsync( fileno( f ) );
|
||||
}
|
||||
cout << "flush: " << t.millis() << "ms" << endl;
|
||||
}
|
||||
@ -39,6 +40,7 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user