rapid7 / rex-core

Created by David Maloney via the GitHub Connector
Other
4 stars 23 forks source link

Add the stopwatch function #17

Closed zeroSteiner closed 2 years ago

zeroSteiner commented 2 years ago

This adds a convenient wrapper function to correctly time the duration of operations. This can, for example, be used to calculate how long a server takes to respond in an exploit's check method.

gwillcox-r7 commented 2 years ago

Woops I landed this but in all honesty I think @adfoster-r7's points are valid consideration. @zeroSteiner do we want to edit this to be more future proof? I don't think there is anything strictly wrong with what we are doing right now but I do forsee this work being expanded on down the line.

zeroSteiner commented 2 years ago

Yeah I can make another PR tomorrow to switch it to a Stopwatch module with an elapsed_seconds method like @adfoster-r7 suggested. Unfortunately the version was automatically bumped already.

gwillcox-r7 commented 2 years ago

No problem I thought this might be the case, will review the PR when you put it up and make sure the bump to MSF occurs only after that PR is reviewed and merged in.