1. A method in an electronic device, the method comprising: acquiring, by executing an information acquisition program stored in a memory, information detected via at least one sensor included in the electronic device and information associated with resource usage of the electronic device; determining an algorithm to be changed based on the information acquired by using the at least one sensor and information associated with the resource usage; determining a complexity of the algorithm based on the information acquired by using the at least one sensor and the information associated with the resource usage; executing the algorithm based on the determined complexity of the algorithm; and displaying, using a display, a message associated with a function executed by the algorithm, wherein the complexity of the algorithm is determined according to a number of steps comprising the algorithm and values of variables comprising the algorithm.