You would have to monitor and record the wattage over a period of time. But if, as you say, the wattage changes faster than either the unit or you can record the reading, I don't see a way to measure the energy accurately.
However, we could estimate a maximum for the energy. If you can get an idea of what the peak power is when you turn the unit on, and for how long it operates at peak power, then simply multiply
power x time (in hours)
to get the estimate. The extra energy consumed when you turn the device on will be
no larger than this number.
Moreover ... you mentioned earlier considering leaving the device on overnight vs. turning it off at night, then back on in the morning. It's unlikely the power surge is large enough to warrant leaving it on:
Overnight, say 8 hours, the device will use
8 W x 8 hrs = 64 W-hrs
We can ask, what would the power and current have to be to use this much energy in 3 seconds when the device is turned on? If the power is "P", then
P x (3/3600) hrs = 64 W-hrs
P = 64 x 3600 / 3 W
P = 77,000 W
And for current,
I ≥ P / V
I ≥ (77,000 / 120) Amps
I ≥ 640 Amps
This is at least 30 times what most household circuits (in USA) can handle, 15 to 20 A!
So leaving the device on overnight will use at least 30 times as much energy as is used in the surge when the device is turned on.
You did say "a few seconds", and I assumed 3 seconds in this calculation. I also assumed "overnight" is 8 hours, and a 120V household. You can adjust those numbers if they are different, but the basic conclusion won't change.
Hope that helps.