Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <b_io> // http://pastebin.com/HhZmT4JV
- new const my_array[100] = {1, ...};
- public OnFilterScriptInit()
- {
- print("\n====================");
- print("= Some test script =");
- print("= Loaded =");
- print("====================\n");
- if(fexist("some_test_file.bin")) fremove("some_test_file.bin");
- new a = GetTickCount(), b, BFile:file_handle = BIO::open("some_test_file.bin", b_io_mode_write);
- if(file_handle)
- {
- for(new i = 0; i < 100000; i++) BIO::write_8_arr(file_handle, my_array);
- BIO::close(file_handle);
- }
- b = GetTickCount();
- printf("BIO::write_8_arr took %d ms.", b-a);
- fremove("some_test_file.bin");
- a = GetTickCount();
- new File:file_handle_2 = fopen("some_test_file.bin", io_write);
- if(file_handle_2)
- {
- for(new i = 0; i < 100000; i++) for(new j = 0; j < sizeof my_array; j++) fputchar(file_handle_2, my_array[j], false);
- //fblockwrite(file_handle_2, my_array);//
- fclose(file_handle_2);
- }
- b = GetTickCount();
- printf("fputchar took %d ms.", b-a);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n====================");
- print("= Some test script =");
- print("= Unloaded =");
- print("====================\n");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment