public void calculate()
    {
        cicles++;

        double timeBetweenMeasures = System.currentTimeMillis() - lastShowTime;

        if (timeBetweenMeasures < 1000)
            return;

        timeBetweenMeasures /= 1000;
        cps = cicles / timeBetweenMeasures;
        cicles = 0;
        lastShowTime = System.currentTimeMillis();
    }