title: How can I take any function as input for my Scala wrapper method?
body: <p>Let's say I want to make a little wrapper along the lines of:</p>
  
  <pre><code>def wrapper(f: (Any) =&gt; Any): Any = {
    println("Executing now")
    val res = f
    println("Execution finished")
    res
  }
  
  wrapper {
    println("2")
  }
  </code></pre>
  
  <p>Does this make sense? My wrapper method is obviously wrong, but I think the spirit of what I want to do is possible. Am I right in thinking so? If so, what's the solution? Thanks!</p>