Calculate power on time of a buzzer
The beeper does not draw a constant 25 mA at all voltage levels between 3.5 V and 5.0 V, and we do not know what the actual current draw is (&lt;=25 mA could mean 2 or 22).  So the best we can do now is make some assumptions to at least get a feel for a solution.
Worst case is that the buzzer draws the full 25 mA at all operating voltages, and shuts off at 3.499 V.  In this case, the equation for capacitor voltage during a constant current charge or discharge is
E x C = i x t   &gt;&gt;&gt;   The change in capacitor voltage times the cap value (in farads) equals the constant current (in amperes) times the time the current is applied.
In your case you have a 0.001 F capacitor, a 25 mA current, and a change in capacitor voltage of 1.5 V (5 V down to 3.5 V).  Therefore, the beeper will beep for 0.06 seconds.
This is 40% less than the other calculation.  One reason is that while the total energy in the cap is 12.5 mJ, not all of that energy can be used.  At some voltage between 3.4999 V and 0 V, the beeper will stop beeping because there is not enough voltage headroom to run the internal 1-transistor oscillator.  We do not know what the true minimum operating voltage is, but we know it could be 3.499999 V.
On the other hand, as the operating voltage decreases from 5 V to 3.5 V, the current draw also decreases.  This will increase the operating time to something greater than 0.06 seconds, but we don't know by how much because the current decrease is not perfectly proportional to the voltage decrease.  My guess is that the increase due only to this is in the 10% to 30% range.
AND - If you use the total energy calculation method, you come up with a worse worst case run time of only 0.051 seconds.  But if you calculate the buzzer energy at both the beginning (125 mW) and end (87.5 mW) of a discharge cycle and average the two as an approximation of the total power throughout a cycle (rather than use 125 mW throughout), you get the same answer as before:  0.06 s.
Again, this is a worst case approximation.  The actual time probably will be about twice this.  And if the beeper actually operates down to 2 V or so, the run time will be much longer.