Skip to content

Instantly share code, notes, and snippets.

@gegeke
Created June 5, 2019 10:25
Show Gist options
  • Save gegeke/3aa6bd7ce27b03a722ac65dde86bd43d to your computer and use it in GitHub Desktop.
Save gegeke/3aa6bd7ce27b03a722ac65dde86bd43d to your computer and use it in GitHub Desktop.
Addition benchmarking with for i++
export const addSingle = (items, noItems) => {
return new Promise((resolve) => {
let sumData = 0
for (let i = 0; i < noItems; i++) {
sumData += items[i].data1
}
resolve(sumData)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment