In this study, 9-anthracenemethyl methacrylate (AMMA) and styrene (St) as monomers and benzoyl peroxide as an initiator were used to synthesize P(St-co-AMMA), a macromolecule tracer with a fluorescence effect, via free radical copolymerization. A fluorescent online detection device was built on the basis of the principle of fluorescence online detection by using the single-screw extrusion platform of a torque rheometer to explore the effect of the amount of macromolecular tracer and screw speed on the residence time distribution of polystyrene in single-screw extrusion. Fourier transform infrared spectroscopy, 1H-NMR, thermal stability, fluorescence properties, and rheological properties show that the resulting product P(St-co-AMMA) has a degree of thermal stability, fluorescence, and rheological properties similar to polystyrene, so this product can be used to characterize the residence time distribution during single-screw extrusion. The amount of macromolecular tracer P(St-co-AMMA) does not affect the residence time distribution of polystyrene during single-screw extrusion processing, meanwhile, the minimum residence time decreases and the residence time distribution becomes narrow as the screw speed increases, that is, the axial mixing capacity of the single-screw extruder decreases as the screw speed increases.