startEvent method

void startEvent(
  1. String event
)

Implementation

void startEvent(String event) {
  if (!_enable) {
    return;
  }
  var currentEvent = _currentEvent;
  if (currentEvent != null) {
    currentEvent.endTime = currentTimeMillis();
    _events.add(currentEvent);
    var cost = currentEvent.endTime - currentEvent.startTime;
    LogUtils.profile(currentEvent.eventName, cost);
  }

  if (isEmpty(event)) {
    return;
  }

  _currentEvent = EngineMonitorEvent();
  currentEvent = _currentEvent;
  if (currentEvent != null) {
    currentEvent.eventName = event;
    currentEvent.startTime = currentTimeMillis();
  }
  LogUtils.d("voltron", "startEvent: $event");
}