Updated sum functions to be identical

This commit is contained in:
Sophia Szady 2022-06-22 18:42:03 +00:00
parent 93b4dc3703
commit 0965ff479d
4 changed files with 5 additions and 5 deletions

View File

@ -12,12 +12,12 @@
function sum(start, length) function sum(start, length)
local sum =0 local sum =0
print(start) print(start)
for x=0,10000000 do for x=0,10000000 do
for x=start,(start+length) do for x=start,(start+length-1) do
sum = sum + x; sum = sum + x;
end end
end end
return sum return sum
end end
-- print(sum(1)) -- print(sum(1))

View File

@ -92,8 +92,8 @@ void call_wasm_function()
clock_t start_t, stop_t; clock_t start_t, stop_t;
double total_t; double total_t;
printf("%s\n", __FUNCTION__); printf("%s\n", __FUNCTION__);
wasm_argv[0] = 0; wasm_argv[0] = 2;
wasm_argv[1] = THREAD_NUM * 10; wasm_argv[1] = 3;
/* /*
* Execute the wasm function in current thread, get the expect result * Execute the wasm function in current thread, get the expect result