diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_test.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c index 134c536..90dc5ac 100644 --- a/LuaSL/src/LuaSL_test.c +++ b/LuaSL/src/LuaSL_test.c | |||
@@ -16,7 +16,9 @@ typedef struct | |||
16 | 16 | ||
17 | static Eina_Strbuf *clientStream; | 17 | static Eina_Strbuf *clientStream; |
18 | static int scriptCount = 0; | 18 | static int scriptCount = 0; |
19 | static int compiledCount = 0; | ||
19 | static float compileTime = 0.0; | 20 | static float compileTime = 0.0; |
21 | static struct timeval startTime; | ||
20 | 22 | ||
21 | static const char *names[] = | 23 | static const char *names[] = |
22 | { | 24 | { |
@@ -96,6 +98,7 @@ static void dirList_compile(const char *name, const char *path, void *data) | |||
96 | { | 98 | { |
97 | script *me = calloc(1, sizeof(script)); | 99 | script *me = calloc(1, sizeof(script)); |
98 | 100 | ||
101 | scriptCount++; | ||
99 | gettimeofday(&me->startTime, NULL); | 102 | gettimeofday(&me->startTime, NULL); |
100 | snprintf(me->SID, sizeof(me->SID), "%s/%s", path, name); | 103 | snprintf(me->SID, sizeof(me->SID), "%s/%s", path, name); |
101 | snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name); | 104 | snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name); |
@@ -136,6 +139,7 @@ static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Server_Ad | |||
136 | char buf[PATH_MAX]; | 139 | char buf[PATH_MAX]; |
137 | 140 | ||
138 | game->server = ev->server; | 141 | game->server = ev->server; |
142 | gettimeofday(&startTime, NULL); | ||
139 | snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); | 143 | snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); |
140 | eina_file_dir_list(buf, EINA_TRUE, dirList_compile, game); | 144 | eina_file_dir_list(buf, EINA_TRUE, dirList_compile, game); |
141 | // Wait awhile, then quit all scripts we started, for testing. | 145 | // Wait awhile, then quit all scripts we started, for testing. |
@@ -178,9 +182,13 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
178 | 182 | ||
179 | me->compileTime = timeDiff(&now, &me->startTime); | 183 | me->compileTime = timeDiff(&now, &me->startTime); |
180 | me->running = TRUE; | 184 | me->running = TRUE; |
181 | scriptCount++; | 185 | compiledCount++; |
182 | compileTime += me->compileTime; | 186 | compileTime += me->compileTime; |
183 | PI("Average compile speed is %f scripts per second", scriptCount / compileTime); | 187 | PI("Average compile speed is %f scripts per second", compiledCount / compileTime); |
188 | if (compiledCount == scriptCount) | ||
189 | { | ||
190 | PI("*********************TOTAL compile speed is %f scripts per second", compiledCount / timeDiff(&now, &startTime)); | ||
191 | } | ||
184 | } | 192 | } |
185 | PD("The compile of %s worked, running it now.", SID); | 193 | PD("The compile of %s worked, running it now.", SID); |
186 | snprintf(buf, sizeof(buf), "%s.lua.out.start()\n", SID); | 194 | snprintf(buf, sizeof(buf), "%s.lua.out.start()\n", SID); |