Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:benchmark_harness/benchmark_harness.dart';
- class SubstringBenchmark extends BenchmarkBase {
- SubstringBenchmark() : super('Substring benchmark');
- String str;
- void setup() {
- final str =
- "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
- final arr = new List.filled(999, str);
- this.str = arr.join();
- }
- void run() {
- while (str.length > 1) {
- str = str.substring(1);
- }
- }
- }
- main(List<String> args) {
- new SubstringBenchmark().report();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement