Porous, atomically thin graphene membranes have interesting properties for filtration and sieving applications. Here, graphene membranes are used to pump gases through nanopores using optothermal forces, enabling the study of gas flow through nanopores at frequencies above 100 kHz. At these frequencies, the motion of graphene is closely linked to the dynamic gas flow through the nanopore and can thus be used to study gas permeation at the nanoscale. By monitoring the time delay between the actuation force and the membrane mechanical motion, the permeation time-constants of various gases through pores with diameters from 10-400 nm are shown to be significantly different. Thus, a method is presented for differentiating gases based on their molecular mass and for studying gas flow mechanisms. The presented microscopic effusion-based gas sensing methodology provides a nanomechanical alternative for large-scale mass-spectrometry and optical spectrometry based gas characterisation methods.