sclass countDispatch_Data {
  int running;
  long invocations, totalTime;
}

static Map<S, countDispatch_Data> countDispatch_map = synchroMap();

static Closeable countDispatch(fS methodName) {
  countDispatch_Data data;
  synchronized(countDispatch_map) {
    data = countDispatch_map.get(methodName);
    if (data == null) countDispatch_map.put(methodName, data = new countDispatch_Data);
  }
  data.running++;
  final countDispatch_Data _data = data;
  final long time = sysNow();
  ret new Closeable { public void close {
    _data.totalTime += sysNow()-time;
    _data.running--;
    _data.invocations++;
  }};
}