Speaking about the question in bold, namely "how long a cyborg needs to spend to determine if the sound it receives is a gunshot" - this highly depends on whether that cyborg has microphones capable of receiving frequencies beyond human hearing range, whether it can process signals at the rate at least twice faster than maximum frequency that its microphones can register, and whether the exact spectra of all the guns are foreknown by it. The first parameter here is measurable, a short search returned that there are microphones that can register frequencies up to 500 kHz, the second is assumed to be "ideal" that is, all channels are captured somewhere without lag, and the third is assumed to be ideal without quotes, that is, as soon as the cyborg receives audio that's matched at least some high-frequency part of any gunshot sample, it says "Gunshot detected".
First, such a cyborg would be limited by DSP rate, even if there would be a ready-made FPGA to perform a FFT/FPT (there's a research that says gunshots are good candidates to run FPT together with FFT, this one ) that would do a moving FFT/FPT over enough samples to discern frequencies from 500 kHz down to another adjustable factor (named FL), FPGAs still do not return result values fast enough to say "almost instant", this kind of an FPGA would have to work on at least 1 MHz operating over no less than 256*500/FL samples of a microphone, the output delay can get big enough due to sheer path travelled by all the signals within the FPGA and all the time to shift triggers within it, etc etc, thus 1 MHz might even not be reached if FL is low enough, based on the current technology. Lowering the FL would allow for less false positives if a certain combination of high-frequency sounds would actually happen to appear without a gunshot being fired to trigger the recognizing circuit, raising it might hit a situation where in a certain gunshot pattern there will be 1 to 0 distinct high frequencies upon which to react, either invalidating the detection completely or triggering it by a single frequency peak. Also, I am not aware of gunshot patterns containing frequencies this high, but I assume they do because a gunshot is essentially a single impulse with diminishing Fourier spectre towards infinity. Assuming that 1 MHz DSP rate is actually reached, and FL set to low enough to avoid most false positives, the FPGA alone would produce a pattern matching a gunshot in 256M/FL microseconds. Say if FL is 125kHz, top frequency is 500kHz, and all the patterns contain enough data to detect a gunshot in this frequency interval, the FFT/FPT data of a heard gunshot will be ready in 1024 microseconds, or a little more than a millisecond.
(PS: this 256 is an arbitrary number that is also a subject to change, it can be changed to a power of 2, and depends on the incoming signal patterns, whether they align to FFT frequency values for a given sampling freq. I don't have any of these, especially for high-frequency region which would provide the earliest info about the gunshot which is sought here, so wherever 256 is read above, a lesser value could also fit, reducing resultant data flow downstream as well as reaction time, but increasing false positive rate. Afterwards I assume that 256 is the lowest value that, together with selected FL, provides acceptable false positive rate.)
Second, the signal has to be processed to match stored patterns. This can also be done with FPGAs, although they first have to operate over the same amount of data, and they have to do that fast enough so the data won't change while processing is performed. This requires a buffer of some kind in the cyborg's circuitry between the sampler/FFT/FPT and the matchers. This adds to latency, which mostly depends on how the buffer is organized, whether it can serve all the pattern matching FPGAs per cycle with the entire set of data (which for FFT is 4 bytes per frequency bin, and with a sample size of 1024 per above paragraph takes considerable amount of time to both be collected from FFT FPGA and get loaded into a receiving circuit over whatever data bus there would be) and should there be too many of those patterns per receiver, whether the matching circuit that wiuld prodice a detection would receive a sample fast enough. But, since the incoming data flow is constant at a rate of 1 matching sample per microsecond, and the lowest amount of matchers that a sample would be fed into is one, the resultant delay can be no more than 2+1*number of samples, in mincroseconds, where 2 contains 1 as the time to transfer data to the buffer, and another 1 for the matcher FPGA to produce a yes signal. The signal can actually share an analogue bus line (a wire) to send a logical 1 via diode to a single collector like a processor pin dedicated to an interrupt.
So, assuming current tech and some data about unavailable cyborg architecture and gunshot patterns with high frequency range, the minimum delay at which a cyborg could detect a known gunshot sound is no greater than 1026+samples, in microseconds, starting from the moment the gunshot's front sound wave reaches the cyborg's microphone(s). This value can be reduced by selecting less samples in FFT+FPT block, lowering the intermittent data size, optimizing data bus to make more matches per sampling cycle or probably advancing to better technology in making cyborgs.
The thing highly differs if a cyborg is required to detect an unknown gunshot, like one from a freshly made weapon, the solution would likely involve a trained neural network translated into a FPGA, if there could be an FPGA to contain the NN, and reaction times would most likely severely increase.