mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
0c071662a7
user tags TEST=cpu_sample_streaming_test.dart Change-Id: Ia983217ae2a5da8c3252fafbed8197b4f4a20e2b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224040 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
25 lines
537 B
Dart
25 lines
537 B
Dart
// Copyright (c) 2021, 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 'dart:developer';
|
|
|
|
fib(int n) {
|
|
if (n <= 1) {
|
|
return n;
|
|
}
|
|
return fib(n - 1) + fib(n - 2);
|
|
}
|
|
|
|
void main() {
|
|
final tag = UserTag('Testing')..makeCurrent();
|
|
final tag2 = UserTag('Baz');
|
|
int i = 5;
|
|
while (true) {
|
|
tag.makeCurrent();
|
|
++i;
|
|
fib(i);
|
|
tag2.makeCurrent();
|
|
fib(i);
|
|
}
|
|
}
|