It not only depends on the duty cycle but what amps you are welding with.
So you need to know what the primary amperage is and the duty cycle. using ohms law get your primary watts - a little more than the secondary wattage due to losses in the transformer and diodes. price per kW.
Well, a kilowatt of electricity costs 0.10 where I live. You have to adjust for where you live.
Diesel fuel is about $3.00 right now. Diesels consume about .4 lb/hp/hour. So if your welder is 160 hp (a bit more than 100 kW, to allow for generator inefficiency) running it for one hour would consume 64 lb of diesel fuel. That's about 9 gallons, or $27 worth. 100 kWh would cost about $10.00. So for the same duty cycle, electricity will cost you about 1/3 what diesel fuel will cost you. (Actual duty cycle will be a small fraction of the maximum constant output of the welder: it is unlikely that even a full day of welding would cost you $10.00 in electricity, or $27 in diesel.)
__________________
There is more to life than just eating mice.
You are right at full duty cycle but the diesel will cost about $30 maybe more just to keep it running all day even if you don't weld while the electricity cost basically zero when you don't weld.
There is basically no overhead expense to keep the electric welder available all day while there is a large expense to keep the diesel available.
__________________
Experienced is earned, common sense is taught, both are rare essentials of life.
Generally true. However, in a modern diesel welder the idle fuel consumption is likely to be less than 1 gph.
But I'm picking nits -- what you say is true: there is a huge benefit to only paying for the energy really used for the welding, rather than having a diesel sitting around doing nothing, most of the time, other than making noise, heating up the air around it, burning through resources, and creating pollution.
__________________
There is more to life than just eating mice.
Ken, right again. When welding on location, say as when putting steel stairs up, or for final installations on a gate, or in some cases of steel beams, a portable diesel powered welding system is required. At your shop your are best to plug in, in the areas I have lived, which are typically wired.
As far as power fluctuations or interruptions are concerned there is always the possibility that that will be the nature of the available grid supply. A mature grid such as common to Manhattan and New York is remarkably consistent. Compared to Pennsylvania, where you never know what you are going to get. Still I've never heard a welder complain about his voltage surges, or hertz problems.
I have heard them say that if the power went out it was nice to have the welding generator around to power the house.
__________________
You don't get wise because you got old, you get old because you were wise.
Always cheaper to use the mains supply - BUT is it capable of coping with sudden bursts of 100kW? Are you working in an area where this irregular draw may cause problems with other equipment?
We always use our own generators when on site - partly to ensure that we do not cause inconvenience to others, but mainly so we know when the electricity is isolated.
I work a good bit on location and I use a 20 hp gasoline welder with a built in 10 KW AC generator that runs all my equipment nicely. I can work a good 10 hour day on about seven to eight gallons of gasoline and weld with up to 5/32" welding rod (150 amps) with this in mind I am only probably welding at the most 5-6 hours a day and using the generator at low to medium load most of the rest of the 10 hour day. I have a diesel welder too but the way the diesel prices are in my area the gasoline makes better sense to use. Using portable welders will never be as cheap as using the main electrical power if you have it. I am assuming this is not a choice for you in this situation becauseI find myself in this same situation many times in the field work.