Task.Wait() I don't fully understand the principle of operation

Hello everyone. I have two questions related to the operation of the function Task.Wait()

  1. I wrote a script for a sprint. When you click on the shift, the player runs and stamina is spent. It works, but recently I decided to check my endurance by a stopwatch. Here is my piece of code:
function OnBindingPressed(player, bindingPressed)
    if bindingPressed == shiftKeyBinding then    
      sprintTable[player] = true
function CheckForStaminaChange(player,dt)
  local stamina = player:GetResource("MaxStamina")
  local correntStamina = player:GetResource("CorrentStamina")

  if sprintTable[player]  then
         correntStamina = correntStamina - 1
         player.maxWalkSpeed = sprintingSpeed

According to my idea, the player has 100 units of endurance, and 1 unit is spent every 0.1 seconds. Therefore, 10 units should be spent in 1 second, and all 100 units of endurance should end in 10 seconds. BUT!!! When I checked the endurance consumption using a stopwatch, it turned out that 100 units of endurance are consumed in 15 seconds... Question: Why???

  1. I made a stimulator that temporarily increases health, and set it the following logic for the duration of the action time:
function Tick()
	for _, player in pairs(Game.GetPlayers()) do
function BigHPEnd (player)
  if player:GetResource("StimulantBigHP") == 1 then
    local currentDurationBigHPTime = player:GetResource("CurrentDurationBigHPTime")
    currentDurationBigHPTime = currentDurationBigHPTime - 1

    if currentDurationBigHPTime > 0 then
      player:SetResource("CurrentDurationBigHPTime", currentDurationBigHPTime)
    else ....

Suppose, currentDurationBigHPTime = 10. I display the value of the currentDurationBigHPTime on the User Interface. I expect that every second the currentDurationBigHPTime will decrease by 1 (because Task.Wait(1)), but as a result I get the following sequence: 10, 8, 6, 4, 2. That is, the currentDurationBigHPTime is reduced not by 1 unit, but by 2. Question: why and what did I do wrong again? Thank you all in advance.