Simple PHP function for timing sales