## 1 Introduction  
An International Data Corporation (IDC) report predicts that there will be 41.6 billion IoT devices in 2025 with a potential for data generation up to 79.4 ZB [1]. IoT applications emerged with artificial intelligence, artificial vision, and object tracking in such a context that requires high computing power [2, 3]. They usually rely on task processing offload and data storage to remote cloud computing (CC) data centers to boost processing time and reduce battery energy consumption [4]. Unfortunately, those remote servers are geographically located away from the end user and IoT devices, resulting in high latency due to delay and congestion over the communication channels [5, 6, 7]. Moreover, the use of centralized control (provider-centric) cannot deliver proper connectivity or even support computation closer to the edge of the network, thus becoming inefficient for highly distributed scenarios. Mobile edge computing (MEC) can represent an option to increase the performance of CC applications, as it denotes a network architecture designed to provide low latency with adequate quality of service (QoS) to end users [8, 9]. MEC relies on top high-speed mobile networks such as 5G to allow fast and stable connectivity for mobile devices and users. Thus, CC services can be deployed close to mobile devices, in the MEC layer, bringing processing and storage closer to cellular base stations [10]. Nevertheless, energy consumption remains a clear issue to be overcome on mobile device networks, such as MEC environments [11]. Most IoT sensors and mobile devices run on batteries with limited energy capacity [12]. Furthermore, IoT devices need to handle lots of data, which is also energy-consuming. Thus, reducing energy consumption in networks with IoT devices is a goal worth exploring. The state of the art presents a set of studies that use MEC to offload tasks to offer local processing for IoT devices. Some works [4; 13; 14; 15; 16; 17] have measured the energy consumption for data transmission or even using dynamic voltage and frequency scaling (DVFS) techniques. In contrast, this proposal enables a more detailed cost model, including energy and time consumed during processing and the cost of data transmissions. CC is also considered an option for processing when local resources are depleted, making the network more reliable in stress scenarios [18]. In this work, we explore the scheduling problems in edge computing environments, considering energetic consumption in a dynamic cost model to mitigate energy consumption in MEC environments. An algorithm called the Time and Energy Minimization Scheduler (TEMS) scheduling algorithm implements dynamic cost minimization policies correlating the system resource allocation with the more inexpensive cost for executing tasks. A simulator was developed for MEC evaluation with IoT devices and associated CC resources. The TEMS algorithm gathers data about the environment and associated energy and time costs to make decisions about the task scheduling. Code of the MEC Simulator is available at [[https://github.com/jlggross/MEC-simulator](https://github.com/jlggross/MEC-simulator)]([https://github.com/jlggross/MEC-simulator](https://github.com/jlggross/MEC-simulator)). The main contributions of this work are:  
1. [label=()]
2. The methodology covers a considerable number of energy and time metrics for task processing and data transmissions, including the accounting of idle CPU cores energy consumption;
3. The CPU processing time and energy consumption optimization using DVFS technique;
4. The scheduling policies consider task processing in the IoT device itself, in a local MEC server, and in a remote data center from CC at the same time. The remainder of this paper is organized as follows. Section 2 discusses previous related work found in the literature. Section 3 lists the problems in MEC environments.