Created
June 7, 2023 20:11
-
-
Save IslamRustamov/e48a7739585d9b3e1ccb0a8a436b4a2f to your computer and use it in GitHub Desktop.
This file contains 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
Future<void> _sort() async { | |
try { | |
double mean = 0; | |
for (var i = 0; i < 1000; i++) { | |
final stopwatch = Stopwatch()..start(); | |
await platform.invokeMethod('sort', list10); | |
stopwatch.stop(); | |
// Don't worry, I converted it to milliseconds afterwards | |
mean += stopwatch.elapsed.inMicroseconds; | |
stopwatch.reset(); | |
} | |
print(mean / 1000); | |
} on PlatformException catch (e) { | |
print("error: '${e.message}'."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment