////
// Fun vram counter at startup.

import { $ } from "./dom"

const vramCounter = $("vram-size")!

export const startVramCounter = () => {
    const timer = setInterval(() => {
        const count = parseInt(vramCounter.textContent!) + 1
        let val = count + "KB"
        if (count < 10)
            val = "0" + val

        vramCounter.textContent = val

        if (count >= 64) {
            vramCounter.textContent += " OK"
            clearInterval(timer)
        }
    }, 15)
}