In urban traffic, a bus’ running speed is greatly influenced by the time-dependent road conditions. Based on historical GPS data, this paper formulates a bus’ running speed between each pair of adjacent stops as a step function. A minimum-cost timetabling model is proposed, in which the total operation cost consists of the cost for a fixed setup and that for variable fuel consumption. Furthermore, a genetic algorithm with self-crossover operation is used to optimize the proposed integer nonlinear programming model. Finally, a real-world case study of Yuntong 128 bus line in Beijing is presented. Comparisons among popular timetabling models are given, involving time-dependent running speed, minimum running speed, maximum running speed and average running speed. The results demonstrate that the consideration of time-dependent running speed is helpful to improve the prediction accuracy of the fuel consumption cost by around 12.7%.