# Duration Of Timer

Grammar — Duration of t
FlagsNative | Function

Returns the duration left of the timer.

# Arguments

  • timer — Timer

Returns — fixed

native fixed TimerGetDuration(timer t);

Category: Timer / Timers

# Examples

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:848

    // Implementation
    TimerStart(lv_cannonActivationWarningTimer, lv_warningTime_C, false, c_timeGame);
    TextExpressionSetToken("Param/Expression/lib_MDoE_CB8DE8D6", "A", TextTimeFormat(StringToText("<sectotal/>"), FixedToInt(TimerGetDuration(lv_cannonActivationWarningTimer))));
    TextTagSetText(lv_orderTextTag, TextExpressionAssemble("Param/Expression/lib_MDoE_CB8DE8D6"));
    TextExpressionSetToken("Param/Expression/lib_MDoE_85F1D362", "A", TextTimeFormat(StringToText("<sectotal/>"), FixedToInt(TimerGetDuration(lv_cannonActivationWarningTimer))));

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:850

    TextExpressionSetToken("Param/Expression/lib_MDoE_CB8DE8D6", "A", TextTimeFormat(StringToText("<sectotal/>"), FixedToInt(TimerGetDuration(lv_cannonActivationWarningTimer))));
    TextTagSetText(lv_orderTextTag, TextExpressionAssemble("Param/Expression/lib_MDoE_CB8DE8D6"));
    TextExpressionSetToken("Param/Expression/lib_MDoE_85F1D362", "A", TextTimeFormat(StringToText("<sectotal/>"), FixedToInt(TimerGetDuration(lv_cannonActivationWarningTimer))));
    TextTagSetText(lv_chaosTextTag, TextExpressionAssemble("Param/Expression/lib_MDoE_85F1D362"));
    TextTagShow(lv_orderTextTag, PlayerGroupAll(), true);

mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmodbase.stormdata/LibPEB1.galaxy:12654

    }

    if ((TimerGetDuration(libPEB1_gv_archangel1_Timer) > 0.0)) {
        if ((TimerIsPaused(libPEB1_gv_archangel1_Timer) == false)) {
            TimerPause(libPEB1_gv_archangel1_Timer, true);

mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmodbase.stormdata/LibPEB1.galaxy:12663

    }

    if ((TimerGetDuration(libPEB1_gv_archangel2_Timer) > 0.0)) {
        if ((TimerIsPaused(libPEB1_gv_archangel2_Timer) == false)) {
            TimerPause(libPEB1_gv_archangel2_Timer, true);

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1551

    // Implementation
    DialogControlSetVisible(libMHPP_gv_mHPPUI.lv_topPanel_OvertimeContainer, PlayerGroupAll(), true);
    while ((TimerGetDuration(libMHPP_gv_payload.lv_overtimeTimer) > 0.0) && (TimerGetRemaining(libMHPP_gv_mHPP_DefenseTimeToWinTimer) <= 0.0)) {
        libNtve_gf_SetDialogItemCurrentValue(libMHPP_gv_mHPPUI.lv_topPanel_OvertimeProgressBar, (TimerGetRemaining(libMHPP_gv_payload.lv_overtimeTimer) / libMHPP_gv_payload.lv_overtimeTime), PlayerGroupAll());
        Wait(0.0625, c_timeGame);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:12262

    libNtve_gf_SendActorMessageToUnit(lv_leoric, "SetShowStatusBar 1");
    UnitBehaviorAdd(lv_leoric, "LeoricUndying", lv_leoric, 1);
    if ((TimerGetDuration(libGame_gv_players[lv_leoricPlayer].lv_respawnTimer) > 0.0)) {
        UnitBehaviorSetDuration(lv_leoric, "LeoricUndying", TimerGetRemaining(libGame_gv_players[lv_leoricPlayer].lv_respawnTimer));
        UnitBehaviorSetDuration(lv_leoric, "Dead", TimerGetRemaining(libGame_gv_players[lv_leoricPlayer].lv_respawnTimer));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13305

    UnitBehaviorAdd(lv_deadUnit, "Dead", lv_deadUnit, 1);
    UnitBehaviorAdd(lv_deadUnit, "DeadMechanics", lv_deadUnit, 1);
    if ((TimerGetDuration(lv_vikingDeathTimer) > 0.0)) {
        UnitBehaviorSetDuration(lv_deadUnit, "Dead", TimerGetRemaining(lv_vikingDeathTimer));
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:6740

    }

    if ((TimerGetDuration(libGame_gv_players[lp_player].lv_respawnTimer) > 0.0)) {
        UnitBehaviorSetDuration(lv_heroUnit, "Dead", TimerGetRemaining(libGame_gv_players[lp_player].lv_respawnTimer));
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:2821


    TriggerEnable(TriggerGetCurrent(), false);
    while (!((TimerGetDuration(libGame_gv_openTheGatesTimer) > 0.0) && (TimerGetRemaining(libGame_gv_openTheGatesTimer) <= 22.0))) {
        Wait(0.5, c_timeGame);
    }

mods/heroesmapmods/battlegroundmapmods/battlefieldofeternity.stormmodbase.stormdata/LibMLBD.galaxy:1775

        }
        else {
            lv_currentLife = (TimerGetElapsed(libMLBD_gv_mMBOEEventPrepLaningTimer)*lv_maxLife/TimerGetDuration(libMLBD_gv_mMBOEEventPrepLaningTimer));
            if ((lv_currentLife >= 100.0)) {
                UnitSetPropertyFixed(libMLBD_gv_mMBOEBossesLaning, c_unitPropLife, lv_currentLife);

mods/heroesmapmods/battlegroundmapmods/hanamura.stormmodbase.stormdata/LibMHmu.galaxy:1906

    lv_iterator = 1;
    for ( ; lv_iterator <= auto9692B77F_ae ; lv_iterator += 1 ) {
        libGame_gf_ScoreValuesReportRealValueAndLog(lv_iterator, "TimeOnPayload", TimerGetDuration(libMHmu_gv_eOMPusherTimer[lv_iterator]));
        libGame_gf_SendMapSpecificAwardEvent(lv_iterator, TimerGetDuration(libMHmu_gv_eOMPusherTimer[lv_iterator]), false);
    }

mods/heroesmapmods/battlegroundmapmods/hanamura.stormmodbase.stormdata/LibMHmu.galaxy:1907

    for ( ; lv_iterator <= auto9692B77F_ae ; lv_iterator += 1 ) {
        libGame_gf_ScoreValuesReportRealValueAndLog(lv_iterator, "TimeOnPayload", TimerGetDuration(libMHmu_gv_eOMPusherTimer[lv_iterator]));
        libGame_gf_SendMapSpecificAwardEvent(lv_iterator, TimerGetDuration(libMHmu_gv_eOMPusherTimer[lv_iterator]), false);
    }
    return true;

mods/heroesmapmods/battlegroundmapmods/hauntedmines.stormmodbase.stormdata/LibMHtM.galaxy:2759

    libUIUI_gf_MapMechanicsHauntedMinesSetMode(libUIUI_ge_MapMechanicsHauntedMinesModes_Golem);
    while (true) {
        lv_current = (TimerGetElapsed(lv_summonTimer)*100/TimerGetDuration(lv_summonTimer));
        if ((lv_current > 0.1)) {
            UnitSetPropertyFixed(lv_tempGolems[1], c_unitPropLifePercent, lv_current);

mods/heroesmapmods/battlegroundmapmods/infernalshrines.stormmodbase.stormdata/LibMSHE.galaxy:2448

    }

    if ((TimerGetDuration(libMSHE_gv_mMISObjectivePreviewTimer) > 0.0)) {
        libNtve_gf_StopTimer(libMSHE_gv_mMISObjectivePreviewTimer);
        libMSHE_gf_MMISRandomizeNextShrineandShowPreview();

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1014

                libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer] = UnitLastCreated();
                UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
                UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
                libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
            }

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1029

            libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][1].lv_vikingUnit = lv_deadHero;
            UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][1].lv_spiritUnit, "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][1].lv_spiritUnit, 1);
            UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][1].lv_spiritUnit, "AurielResurrectRezzable", (TimerGetDuration(libGDHL_gv_lostVikingsPlayer[lv_deadPlayer].lv_baleogDeathTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
            libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
            TriggerEnable(libHAUR_gt_HeroAurielResurrectLostVikingRespawns, true);

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1044

        UnitSetHeight(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1.0, 0.0);
        UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
        UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
        libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
    }

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1049

    else if (autoDD7969E0_val == "HeroDiablo") {
        Wait(0.125, c_timeGame);
        if ((TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) <= libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime)) {
        }
        else {

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1057

            UnitSetPosition(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], lv_lastKnownPosition, false);
            UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
            UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
            libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
        }

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1070

            libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][2].lv_vikingUnit = lv_deadHero;
            UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][2].lv_spiritUnit, "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][2].lv_spiritUnit, 1);
            UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][2].lv_spiritUnit, "AurielResurrectRezzable", (TimerGetDuration(libGDHL_gv_lostVikingsPlayer[lv_deadPlayer].lv_erikDeathTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
            libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
            TriggerEnable(libHAUR_gt_HeroAurielResurrectLostVikingRespawns, true);

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1086

            UnitSetPosition(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], lv_lastKnownPosition, false);
            UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
            UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
            libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
        }

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1094

            UnitSetPosition(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], lv_lastKnownPosition, false);
            UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
            UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
            Wait(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, "L90ETCDeathMetalTimedLife", "Duration", UnitGetOwner(lv_deadHero)), c_timeGame);
            libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1105

        UnitSetHeight(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 2.0, 0.0);
        UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
        UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
        libHAUR_gf_HeroAurielResurrectRevealSpirittoAurielandDeadPlayer(lv_deadPlayer, lv_deadHero);
    }

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1118

        UnitSetPosition(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], lv_lastKnownPosition, false);
        UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
        UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
        TriggerEnable(libHAUR_gt_HeroAurielResurrectLeoricSpiritFollow, true);
        lv_iPlayer = 1;

mods/novastoryassets.sc2modbase2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:2642

    TriggerExecute(gt_AddProtossUnitsToGlossary, true, false);
    TimerStart(gv_defenseModeTimer, gv_defenseModeDuration, false, c_timeAI);
    libCMUI_gf_DisplayProgressBar(StringExternal("Param/Value/AA832D8E"), 0, FixedToInt(TimerGetDuration(gv_defenseModeTimer)));
    libCMUI_gf_SetProgressBarLabel(StringExternal("Param/Value/5D5D72D7"));
    DialogControlHookupStandard(c_triggerControlTypeImage, "UIContainer/ConsoleUIContainer/ProgressFrameTemplate/BarImage");

mods/novastoryassets.sc2modbase2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:4327

    // Conditions
    if (testConds) {
        if (!((TimerGetDuration(gv_defenseModeTimer) > 0.0))) {
            return false;
        }

mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2mapMapScript.galaxy:2642

    TriggerExecute(gt_AddProtossUnitsToGlossary, true, false);
    TimerStart(gv_defenseModeTimer, gv_defenseModeDuration, false, c_timeAI);
    libCMUI_gf_DisplayProgressBar(StringExternal("Param/Value/AA832D8E"), 0, FixedToInt(TimerGetDuration(gv_defenseModeTimer)));
    libCMUI_gf_SetProgressBarLabel(StringExternal("Param/Value/5D5D72D7"));
    DialogControlHookupStandard(c_triggerControlTypeImage, "UIContainer/ConsoleUIContainer/ProgressFrameTemplate/BarImage");

mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2mapMapScript.galaxy:4327

    // Conditions
    if (testConds) {
        if (!((TimerGetDuration(gv_defenseModeTimer) > 0.0))) {
            return false;
        }