title: Command to check performance of command
body: <p>I have a command to check the performance of another command which returns info like how long the command took to run and if an error occured within it. But this only works with commands, that don't have a permission limit like having administrator perms.</p>
  <p>How can I fix this so that I can bypass the permissions limit of the command that will be checked the performance of?
  The code that I currently have is:</p>
  <pre class="lang-py prettyprint-override"><code>@commands.command(hidden=True)
  @is_owner()
  async def perf(self, ctx, *, command):
          await asyncio.sleep(0.25)
          await ctx.message.delete()
          &quot;&quot;&quot;Checks the timing of a command, attempting to suppress HTTP and DB calls.&quot;&quot;&quot;
  
          msg = copy.copy(ctx.message)
          msg.content = ctx.prefix + command
  
          new_ctx = await self.bot.get_context(msg, cls=type(ctx))
          new_ctx._db = PerformanceMocker()
  
          # Intercepts the Messageable interface a bit
          new_ctx._state = PerformanceMocker()
          new_ctx.channel = PerformanceMocker()
          new_ctx.author = ctx.author
  
          if new_ctx.command is None:
                  return await ctx.send('No command found')
                      
  
          print(new_ctx.content)
          print(new_ctx.author.permissions)
  
          start = time.perf_counter()
          try:
                  await new_ctx.command.invoke(new_ctx)
          except commands.CommandError:
                  end = time.perf_counter()
                  success = False
                  try:
                          await ctx.send(f'```py\n{traceback.format_exc()}\n```')
                  except discord.HTTPException:
                          pass
          else:
                  end = time.perf_counter()
                  success = True
  
          await ctx.send(f'Status: {success} Time: {(end - start) * 1000:.2f}ms')
  </code></pre>