profile.dart 586 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'basic_types.dart';
6
import 'constants.dart';
7

8
/// DEPRECATED. `function` cannot be tree-shaken out of release builds.
9
///
10 11 12 13 14 15 16
/// Instead use:
///
/// ```dart
/// if (!kReleaseMode) {
///   function();
/// }
/// ```
17 18 19 20
@Deprecated(
  'Use `if (!kReleaseMode) { function(); }` instead. '
  'This feature was deprecated after v1.3.9.'
)
21
void profile(VoidCallback function) {
22
  if (kReleaseMode)
23 24 25
    return;
  function();
}