import xlld.test.util: asyncReturn, newAsyncHandle; import xlld.conv.from: fromXlOper; import core.time: MonoTime; import core.thread; const start = MonoTime.currTime; auto asyncHandle = newAsyncHandle; auto oper = (3.2).toXlOper(theGC); wrapAsync!twice(theGC, cast(immutable)asyncHandle, oper); const expected = 6.4; while(asyncReturn(asyncHandle).fromXlOper!double(theGC) != expected && MonoTime.currTime - start < 1.seconds) { Thread.sleep(10.msecs); } asyncReturn(asyncHandle).shouldEqualDlang(expected);