Kitchensink108
6-17-05, 03:50 PM
I got bored at work yesterday, so I wrote a PHP function that took a number, converted it to binary, then generated a javascript function to convert it back to base 10, which was then displayed. Yes, it was useless.
But then I remembered that both PHP and Javascript have automatic base conversion functions. Decided to test the speed of my PHP conversion script to the the speed of bindec(), and found my code was, on average, 10 times slower.
Moral of the story: predefined functions > anything i make.
But then I remembered that both PHP and Javascript have automatic base conversion functions. Decided to test the speed of my PHP conversion script to the the speed of bindec(), and found my code was, on average, 10 times slower.
Moral of the story: predefined functions > anything i make.