You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: profiler.rb
    path of file: ./repos/metasploit-framework/lib/metasploit/framework
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'pathname'
require 'tmpdir'

module Metasploit
  module Framework
    module Profiler
      class << self
        def start
          return unless record_global_cpu? || record_global
    
        def record_memory
          raise 'Cannot mix global memory recording and localised memory recording' if record_global_memory?

          require 'memory_profiler'

          results_path = tmp_memory_results_path
          profile = MemoryProfiler
          profile.start

          yield

          result = profile.stop
          save_memory_result(result, path: results_path)
        end