I posit that we can't know from the record available (the Bible).
Gen 1:1-2 describe the creation of the world itself (as opposed to everything in it or around it), which is the question OP asks. These verses take place prior to the creation of light in Gen 1:3-5, which marks the first mention of any concept of time. Hence, the creation of the world happened before time had any meaning, so it could have been instantaneous, or may have taken longer than the 4,022-ish years that have passed since. If this is too much of a mind-stretch for you to accept let me refer to the existence of light, and plants growing, before there was such a thing as the sun in the sky, as a concept that already exists in your brain (without your skull exploding, somehow).
tl:dr Gen 1:1-2 happen
before the first day (so can't be included in the six total of Exodus 20) and time did not yet exist so