With the development of traffic detection facilities technology, it is currently possible to obtain high-resolution traffic flow data. Due to the particular driving characteristics of vehicles on freeways, once traffic crashes occur, they are generally with serious consequences, and hence traffic safety issues on freeways have always been popular topics. In order to better realize the change from static analysis after the crash to dynamic analysis before the crash toward freeway safety, as well as explore the relationship between dynamic traffic flow characteristics and real-time traffic crash risk under different temporal conditions, this research constructed a real-time traffic crash risk prediction model considering the temporal effect difference. First, traffic crash information and the matched big data of high-resolution traffic flow located on the section of milepost 100–130 of Interstate 5 (I-5) in Washington State, were extracted. In terms of temporal dimension, the research object was divided into weekdays and weekends, and the traffic state was divided into unsaturated and saturated. The random forest (RF) algorithm was introduced to identify the traffic flow variables of crash precursors, and support vector machine (SVM) was applied to build the traffic crash risk prediction model under the condition of temporal difference. A confusion matrix, receiver operating characteristic (ROC) curve, and area under curve (AUC) values were used to evaluate the accuracy of the model performance. Furthermore, the prediction performance of the proposed model was tested via constructing the risk model without consideration of temporal effect and traffic state difference. Finally, the rationality of variable screening was verified by inputting the data set without variable screening into the constructed model. The results showed that the occurrence mechanism of dynamic traffic crashes under different temporal effect conditions varies; the AUC values of the constructed prediction model were all between 0.7 and 0.9, indicating that the recommended model has good prediction accuracy. In conclusion, the real-time freeway traffic crash risk prediction model considering the temporal effect difference has certain advantages compared with the conventional model, and its performance is better than the prediction model without screening of important traffic flow variables. This approach can provide theoretical guidance for dynamic traffic safety management toward freeway under temporal difference conditions.