How long does it typicaly take you to think of a code solution?

Generaly how much time do you take to create solution to write a code for something? Do you seek for help if you are stuck somewhere? Do you look up solutions by googling i.e. how would that code you plam to use work ? Etc…