Traditional optical core networks based on Wavelength Division Multiplexing (WDM) provide optical channels (wavelengths) rigidly allocated over the optical spectrum and separated by 50 or 100 GHz. The novel concept of Elastic Optical Network (EON) can help to improve network flexibility by allocating multiple sub-channels to incoming connection requests with finer bandwidth granularity (hence the term elastic) over a flexible spectrum grid. In this paper, we propose an algorithm for connection resource provisioning in EONs. We compare the performance of flexible-grid EONs to that of fixed-grid WDM networks under dynamic traffic, with and without grooming capability, in terms of blocking probability and network resource (i.e., overall spectrum) occupation, thus showing quantitatively the advantage of EON compared to grooming-based WDM networks.