Kotlin is designed to provide first-class support for operating on functions. For example, we are able to easily pass functions as parameters to a function. We can also create a function that can return another function. This kind of a function is called a higher-order function. This powerful feature helps to write a functional style code easily. The possibility to return a function instead of a value makes along with the ability to pass a function instance to an other function as an argument, makes it possible to defer computations and to shape code cleanly. In this recipe, we are going to implement a helper function that is going to measure the execution time of other functions passed to it as an argument.
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine