Internet of Things (IoT) needs an accurate latency computation. The connected IoT devices generate an enormous amount of data which is processed on the infrastructure of a cloud. However, the cloud is not an effective solution. To address this issue, fog computing enables processing at the edge while still allowing users to communicate with the cloud. Therefore, many applications depend on fog computing, such as traffic management. In this paper, an intelligent Traffic Congestion Mitigation System (ITCMS) is proposed to solve the problem of traffic congestion in crowded smart cities. The proposed system is implemented based on fog computing. It has been applied to a crowded city and its performance is evaluated according to some metrics such as traffic efficiency, saving energy and reducing the latency, the average rate of traffic flow, and waiting time. The obtained results show that the execution time of our simulation takes 4,548 seconds, the Application loop delay takes 49.67 seconds. Thus, the results show better performance, more accuracy, low latency, and traffic efficiency