dart-sdk/benchmarks/Example/dart/Example.dart
Jonas Termansen 24d57fb745 [benchmark] Add top level benchmarks directory.
Benchmarks are checked in as benchmarks/<Benchmark>/dart/<Benchmark>.dart.
This scheme is compatible with our existing benchmarking infrastructure
and will aid migrating the benchmarks with minimal breakage.

This change adds an Example benchmark to show how it is done.

The benchmarks directory is now added to the Dart benchmarking builds.

Change-Id: I25971ba3b219194fa9cfea6b938372d877477e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108414
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-07-10 14:51:14 +00:00

23 lines
611 B
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:benchmark_harness/benchmark_harness.dart';
class Example extends BenchmarkBase {
const Example() : super("Example");
// The benchmark code.
void run() {}
// Not measured setup code executed prior to the benchmark runs.
void setup() {}
// Not measures teardown code executed after the benchark runs.
void teardown() {}
}
main() {
const Example().report();
}