startCollection(name, opts) {
		const options = {
			...defaultCollectionOptions,
			...opts
		};
		/** @type {import('../types/vite-plugin-svelte-stats.d.ts').Stat[]} */
		const stats = [];
		const collectionStart = performance.now();

		const _this = this;
		let hasLoggedProgress = false;
		/** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection} */
		const collection = {
			name,
			options,
			stats,
			collectionStart,
			finished: false,
			start(file) {
				if (collection.finished) {
					throw new Error('called after finish() has been used');
				}
				file = normalizePath(file);
				const start = performance.now();
				/** @type {import('../types/vite-plugin-svelte-stats.d.ts').Stat} */
				const stat = { file, start, end: start };
				return () => {
					const now = performance.now();
					stat.end = now;
					stats.push(stat);
					if (!hasLoggedProgress && options.logInProgress(collection, now)) {
						hasLoggedProgress = true;
						log.debug(`${name} in progress ...`, undefined, 'stats');
					}
				};
			},
			async finish() {
				await _this.#finish(collection);
			}
		};
		_this.#collections.push(collection);
		return collection;
	}
@param {string} name
@param {Partial<import('../types/vite-plugin-svelte-stats.d.ts').CollectionOptions>} [opts]
@returns {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection}