Handle division by zero in characters_per_second

When duration is 0, the program used to throw an error. Now it returns 0. I am not sure if that is the best value to return (float('inf') could be used maybe) but cannot think of anything better and this seems better than throwing an exception.