In IoT application scenarios, the response time is one of the attributes that most require attention and, for this reason, the paradigm of decentralized (or fog) computation has gained ground. Moreover, to help reduce the response time of decentralized IoT networks, routing optimization approaches can be employed using software-defined networking (SDN). When both contexts are combined, a new one called SDN-Fog Environments appears. This work presents a solution to predict the response time of Industrial Internet of Things (IIoT) applications using supervised and unsupervised learning for SDN-Fog Environments. Results show that the prediction of the response time of IIoT scenarios was close to the times obtained by solving the problem in the literature. Furthermore, according to the best-performing models, the prediction framework had less than 50 milliseconds of variation, executed in less than one second.