Sometimes it can be done in minutes.
Sometimes it can be a while.
Sometimes it can really drags you down.
I spent a few hours and yet I couldn't understand why it didn't work.
Turns out it was something else in the code. I was muttering for ages feeling that time was wasted. Sat back and thought about what I have done and learnt in the process. Research, playing with code, understanding how it works.
The simple things in life requires you to learn more.
It reminds me of a quote I have read somewhere some times ago...
"Give a man a fish, he will feed himself for a day,
Teach a man how to fish, he will feed himself for the rest of his life."
Nothing is easy from the get go!