Created
January 4, 2025 19:01
-
-
Save IslamRustamov/25514243ae992a6c0e2f3946da5a8d73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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