## 7 Conclusions  
Energy and time reduction are mostly needed for environments where large volumes of data and mobile devices are connected to the Internet with restricted QoS requirements and battery limitations. The TEMS algorithm chooses the most suitable allocation options in the system, reducing energy waste and elapsed time. Adequate coefficients allowed a decrease of energy consumption up to 51.6% and an execution time reduction up to 86.6%, ending critical tasks inside the deadline. Thus, the system becomes more sustainable, and the user experience is more satisfying.  
The experiments exhibit that MEC server energy consumption is more efficient for applications when occurs task offloading from local IoT to MEC high workload applications and consequently saves battery energy. This is explained because IoT is closer to MEC than cloud. However, when there are high data transfer rates and a high number of tasks, the local processing policy in IoT devices can reduce energy consumption up to 23%, with a decrease in the task execution time of 29%.  
The use of MEC servers helps increase the battery life of the IoT devices and enables agile task execution. Moreover, using the DVFS technique caused exciting results, supporting the energy consumption decrease. This work allowed contributions such as the TEMS algorithm and combining data transmission to the cost model. The model also considers idle costs, data transmission rate interference, using the DVFS technique, and the interaction with the CC layer to provide computational resources whenever the local network becomes overloaded.  
As future works, we can indicate the progression of the system cost model to more fine grain, with the insertion of new variables and new environments to explore applications in different scenarios such as industry, healthcare, aviation, and mining. Another consideration is to evaluate new IoT applications in general cases to improve real-time dynamic mechanisms. We will evaluate finer coefficient controls to achieve the minimum energy consumption and the measured consumption to compare our solution with real world systems.  
Conceptualization, J.C.S.d.A., J.L.G.G., and K.J.M.; methodology, J.C.S.d.A., J.L.G.G., and C.F.R.G.; simulator, J.L.G.G.; validation, J.C.S.d.A. and J.L.G.G.; writing--original draft preparation, J.C.S.d.A., K.J.M., J.L.G.G., and V.R.Q.L.; writing--review and editing, G.V.G. and J.C.S.d.A. All authors have read and agreed to the published version of the manuscript.  
This work has partially supported by PROPESQ-UFRGS-Brasil and Junta De Castilla y Leon-Consejeria de Economia Y Empleo: System for simulation and training in advanced techniques for the occupational risk prevention through the design of hybrid-reality environments with ref. J118.  
Not applicable.  
**Acknowledgments:** \"SmartSent\" (#17/2551-0001 195-3), CAPES (Finance Code 001), PNPD program, CNPq, PROPESQ-UFRGS-Brasil and FAPERGS Project \"GREEN-CLOUD--Computacao em Cloud com Computacao Sustentuel\" (#16/2551-0000 488-9). Proyeto Uso de algoritmos y protocolos de comunicacion en dispositivos con effasis en la privacidad de los datos.  
**Conflicts of Interest**: The authors declare no conflict of interest.