# AIWaveGetTimeSinceRetreat
Flags —
Native
# Arguments
wave
— w
Returns — int
native int AIWaveGetTimeSinceRetreat(wave w);
# Related
Category: Unclassified
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:760
count = AIWaveUnitCount(w) + AIWaveUnitCount(AIWaveGet(player, c_waveMain));
if ((AIWaveGetTimeSinceRetreat(w) > 120) && (AIGetUserInt(player, c_delayNextAttack) < AIGetTime())) {
// if we're allowed to attack && we've waited at least 120 seonds after retreating, consider attacking
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:853
count = AIWaveUnitCount(w) + AIWaveUnitCount(AIWaveGet(player, c_waveMain));
if ((AIWaveGetTimeSinceRetreat(w) > 2) && (AIGetUserInt(player, c_delayNextAttack) < AIGetTime())) {
// if we're allowed to attack && we've waited at least 30 seonds after retreating, consider attacking