How to implement decrement resource over time? (solved)

Let say if i have variable food = 100 , I want to decrease it -1/sec. So it will empty in 1 minutes 40 sec.
What I think is code like this :

function init(self)
  food = 100
end

function update(self, dt)
  food = food - 1  -- I know this code is wrong
  if (food == 0) then
    print("i'm die")
  end
end

How to implement that?

dt (deltatime) that is passed into update is the time that has passed since last update.
In this case you could easily do: food = food - dt

Now that will give you floating numbers of food so when representing food you might want to do math.floor(food)

Also use food =< 0.

Working very well thanks.