profile function

void profile (VoidCallback function)

When running in profile mode (or debug mode), invoke the given function.

In release mode, the function is not invoked.

Implementation

// TODO(devoncarew): Going forward, we'll want the call to profile() to be tree-shaken out.
void profile(VoidCallback function) {
  if (_kReleaseMode)
    return;
  function();
}