Several years ago, when I was just learning Javascript, I ran into a situation where I had to convert a string to it's monetary equivalent -
10 = 10.00
or 15.320000 = 15.32
Rather than spend the time searching for a function to do it for me I wrote out a quick little function to solve the problem. A few days later a friend of mine, who at the time was a much better coder than me, saw it, and reacted like I'd just run over his mom.
Friend: (mouth agape) Why are you doing this?
Me: I didn't want to look for a function.
Friend: There has to be something that does what you want.
Me: I'm sure, but, this does it too.
Friend: (look that suggests friend is questioning his friendship) Always use the functions that are already in the language.
He didn't explain why, and I didn't ask him. It wasn't until a few years later that I learned the reason, and it was so obvious, that I couldn't believe it'd taken me that long to realize it.
The language you're using was built using another language, one closer to the machine. This means that for every instruction you're giving the language you're programming in, that language is giving several instructions to the the language it was programmed in, and so on and so forth until the code reaches the machine. Prebuilt functions are one level closer, which can be much much faster.
Besides the speed benefit, there are direct ones as well. I knew beforehand what I'd have to do to write the toFixed method needed above. There was nothing learned in that. Now that wasn't a terrible waste because the code was easy, and small. But say someone gets in the habit of doing it. A friend of mine was recently working on a program that at first glance seemed easy, but as he got deeper and deeper into it, more and more obstacles popped up. He spent a few days on this, with nothing to show for it. He asked me to take a look at it, and I briefly looked online, almost immediately finding a function that did exactly what he wanted, that was part of the language.
By getting in the habit of looking for what you want, you can in the long run save yourself time. Even if something seems like an uncommon operation look for it. You'd be surprised how many times I've found what I've wanted when I was looking for something I thought was going to be unique to my project.
On a related note - say you're working on a project with a bottleneck, and you can't figure out how to make it faster, a lot of languages have a way to write in the language they were built on, although semi hackish. Take PHP for example, if you're willing and able to recompile the core, you can edit it yourself. In C you can write in Assembly, and in XUL you can write in a host of languages (C, Python, and others, though others will require more work). Put some of the code in one of the lower languages, and get your speedboost. Depending on the cause of the bottleneck you can get up to 7 times the speed. (As a warning, don't overdo this. Maintenance will be a pain, and quite often the bottleneck will be related to bad database queries or just user lag time)
Basically, just spend a few minutes checking when faced with something you haven't done before, in the long run it will save you time, but more importantly it can save your users time.
Why you should use preprogrammed functions