Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <YSI\y_ini>
- #include <Double-O-Files>
- #undef dini_Exists
- #undef dini_Remove
- #undef dini_Create
- #undef dini_Set
- #undef dini_Get
- #undef dini_IntSet
- #undef dini_Int
- #undef dini_BoolSet
- #undef dini_Bool
- #undef dini_FloatSet
- #undef dini_Float
- #undef dini_Unset
- #undef dini_Isset
- #include <Dini>
- #include <SII>
- INI:core[ysi_properties](name[], value[])
- {
- }
- INI:core[ysi_help](name[], value[])
- {
- }
- INI:core[](name[], value[])
- {
- printf("Name: \"%s\"", name);
- printf("Value: \"%s\"", value);
- printf("====");
- }
- INI:testing[](name[], value[])
- {
- // printf("Name: \"%s\"", name);
- // printf("Value: \"%s\"", value);
- // printf("====");
- }
- INI:testing[woo](name[], value[])
- {
- // printf("Name: \"%s\"", name);
- // printf("Value: \"%s\"", value);
- printf("%s = %s", name, value);
- // printf("====");
- }
- new
- gStr[64];
- forward myload(name[], value[]);
- public myload(name[], value[])
- {
- if (!strcmp(name, "EG1_KILL_HELP"))
- {
- strcpy(gStr, value, 64);
- return;
- }
- if (!strcmp(name, "EG1_DROP_HELP_1"))
- {
- strcpy(gStr, value, 64);
- return;
- }
- if (!strcmp(name, "EG1_DROP_SPLAT"))
- {
- strcpy(gStr, value, 64);
- return;
- }
- if (!strcmp(name, "EG1_KILL_HELP"))
- {
- strcpy(gStr, value, 64);
- return;
- }
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- //INI_Load("YSI/core.EN");
- //printf("%d", !strcmp("", "hi"));
- /* INI_Load("testing.ini");
- new
- INI:tt = INI_Open("testing.ini");*/
- /*INI_WriteString(tt, "fa", "aa");
- INI_WriteString(tt, "fb", "aa");
- INI_WriteString(tt, "fc", "aa");
- INI_WriteString(tt, "fd", "aa");*/
- /*INI_SetTag(tt, "woo");
- INI_WriteString(tt, "fa", "ca1");
- INI_WriteString(tt, "fb", "ca1");
- INI_WriteString(tt, "fc", "ca1");
- INI_WriteString(tt, "fd", "ca1");
- INI_RemoveEntry(tt, "fb");
- INI_Close(tt);
- INI_Load("testing.ini");*/
- // _INI_dini("eg1.EN");
- /*printf("%s", _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"));
- printf("%s", _INI_diniGetOne("eg1.EN", "EG1_DROP_HELP_1"));
- printf("%s", _INI_diniGetOne("eg1.EN", "EG1_DROP_SPLAT"));
- printf("%s", _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"));*/
- // printf("%s", GetVehicleNameFromID(10));
- new t0 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_DROP_HELP_1"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_DROP_SPLAT"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"), 64);
- }
- // print(gStr);
- new t1 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- _INI_Close(INI:0);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_DROP_HELP_1"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_DROP_SPLAT"), 64);
- strcpy(gStr, _INI_diniGetOne("eg1.EN", "EG1_KILL_HELP"), 64);
- }
- // print(gStr);
- new t2 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- strcpy(gStr, dini_Get("eg1.EN", "EG1_KILL_HELP"), 64);
- strcpy(gStr, dini_Get("eg1.EN", "EG1_DROP_HELP_1"), 64);
- strcpy(gStr, dini_Get("eg1.EN", "EG1_DROP_SPLAT"), 64);
- strcpy(gStr, dini_Get("eg1.EN", "EG1_KILL_HELP"), 64);
- }
- // print(gStr);
- new t3 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- _INI_ParseFile("eg1.EN", "myload", .eTagless = e_ini_tags_none);
- }
- // print(gStr);
- new t4 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- SINI_Open("eg1.EN");
- SINI_ReadString(gStr, "EG1_KILL_HELP");
- SINI_ReadString(gStr, "EG1_DROP_HELP_1");
- SINI_ReadString(gStr, "EG1_DROP_SPLAT");
- SINI_ReadString(gStr, "EG1_KILL_HELP");
- SINI_Close();
- }
- // print(gStr);
- new t5 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- // To simulate large times between reads.
- DOF_SetFile("-");
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_KILL_HELP"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_DROP_HELP_1"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_DROP_SPLAT"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_KILL_HELP"), 64);
- }
- new t6 = GetTickCount();
- for (new i = 0; i != 100000; ++i)
- {
- // To simulate data still held in buffer.
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_KILL_HELP"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_DROP_HELP_1"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_DROP_SPLAT"), 64);
- strcpy(gStr, DOF_GetString("eg1.EN", "EG1_KILL_HELP"), 64);
- }
- new t7 = GetTickCount();
- printf("%d %d %d %d %d %d %d", t1 - t0, t2 - t1, t3 - t2, t4 - t3, t5 - t4, t6 - t5, t7 - t6);
- }
Add Comment
Please, Sign In to add comment