Yeah, you'd need to get the time as a float or double ( gives more precision based timing ), and then multiply by 1000.00f this will give the time in millisecs. It is a misleading term as you'd expect it to have six zeros after it. And in the example above, 20 seconds is 20 * 1000.00.
And you could even use switch / case statements to signify which part of the demo to run.