too long means what? 1 min or 2 min? BTW do you have too many apps installed. Go to Finder->Applications Remove unwanted. YES. Move to trash. A lot of programs these days use background services to Monitor and WASTE computer resources. All this will need to somehow written to RAM or DISK depending on sleep mode. Or do a fresh install. Go to Activity Monitor and see what is using much RAM/CPU. Launch Pad -> Activity Monitor Insatll this and clean (open source program) https://www.bleachbit.org/
May be try to closely look with a ‘lens’ or microscope for any short/damage to the DC in board. Or replace it. Careful: may be you can cause more damage by opening and analysing. At least it works now!!! MacBook Pro 13" Retina Display Early 2015 MagSafe DC-In Board Replacement
This is not truly easy thing to solve: First get yourself a better battery. May cause more issues than just sparks. next get a logic board: MacBook Pro 15" Retina Display Mid 2014 Logic Board Replacement or the hard way: possible to replace capacitors but you need lots of tools you can look for youtube videos of rossmann + macbook repair if you are in the US try sending to them: http://www.rossmanngroup.com/boards I am not paid by them or so.