wasm-micro-runtime/samples/spawn-thread/wasm-apps/sum.c

15 lines
273 B
C
Raw Normal View History

2020-08-04 09:40:45 +00:00
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
int sum(int start, int length)
{
int sum = 0, i;
for (i = start; i < start + length; i++) {
sum += i;
}
return sum;
}