getTimeSpan method

Duration getTimeSpan()

Implementation

Duration getTimeSpan() {
  final value = calloc<Int64>();

  try {
    final hr = ptr.ref.vtable
            .elementAt(22)
            .cast<
                Pointer<
                    NativeFunction<
                        HRESULT Function(
                            VTablePointer lpVtbl, Pointer<Int64> value)>>>()
            .value
            .asFunction<
                int Function(VTablePointer lpVtbl, Pointer<Int64> value)>()(
        ptr.ref.lpVtbl, value);

    if (FAILED(hr)) throwWindowsException(hr);

    return value.toDartDuration();
  } finally {
    free(value);
  }
}