Skip to content

Instantly share code, notes, and snippets.

@IslamRustamov
Created January 4, 2025 19:01
Show Gist options
  • Select an option

  • Save IslamRustamov/25514243ae992a6c0e2f3946da5a8d73 to your computer and use it in GitHub Desktop.

Select an option

Save IslamRustamov/25514243ae992a6c0e2f3946da5a8d73 to your computer and use it in GitHub Desktop.
const N = 10
const M = 500
const regions: LatLng[] = [];
for (let i = 0; i < N; i++) {
regions.push({
latitude: Math.random() * (90 - (-90) + 1) + (-90),
longitude: Math.random() * (180 - (-180) + 1) + (-180),
// latitudeDelta: Math.random() * (90 - (-90) + 1) + (-90),
// longitudeDelta: Math.random() * (180 - (-180) + 1) + (-180)
})
}
let result = 0
for (let j = 0; j < M; j++) {
const startTime = performance.now()
for (let i = 0; i < N; i++) {
getMarkersRegionC(regions)
}
const endTime = performance.now()
result += endTime - startTime
}
console.log(`Average is ${result / M} milliseconds`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment