How can i restart currentTimeMillis or make this currentTimeMillis work properly : So the problem here is that when i try to run again it won't do anything.
It will run the while once then break. I know that i'm not using currentTimeMillis right does any one know what's the problem here. I'm not good at coding if you have some suggestions to improve my code feel free to tell me.
And yes I tried to look anwsers online but i didn't find anything. Sorry for bad English!




    public static String list(ArrayList<String> lause2) {
        Collections.shuffle(lause2);
        String pleb = lause2.get(lause2.size() - 1);

        return pleb;
    }

    public static void main(String[] args) throws Exception {
        Scanner printer = new Scanner(System.in);
        ArrayList<String> lause2 = new ArrayList<>();
        ArrayList<Integer> keskiarvo = new ArrayList<>();

        long start = System.currentTimeMillis();
        long end = start + 10 * 6000;
        int laskuri = 0;
        
        boolean go = true;
        boolean run = true;

        System.out.println("Welcome to Typefaster");
        System.out.println("Program will give you random words you will write them as fast as you can for an minute if you fail ones it's over Good luck!");
       
        lause2.add("hello");
        //Loads of different lause2.add("random"); 
        lause2.add("vacation");
        
        System.out.println(list(lause2));
        while (System.currentTimeMillis() < end) {
            laskuri++;
            String something = list(lause2);
            System.out.println("Write " + something);
            String kirjoitus = printer.nextLine();
            if (kirjoitus.equals(something)) {
                System.out.println("yee");
            } else {
                break;

            }

        }
        System.out.println("You wrote " + laskuri + " words");
        keskiarvo.add(laskuri);
        int laskuri2 = 0;



            System.out.println("Run again?");
 
        char again = printer.next().charAt(0);
        if (again == 'y') {
            run = true;
            
        } else if (again == 'n') {
            System.out.println("Byebye");
            go = false;
        }
            
        long start2 = System.currentTimeMillis();
        long end2 = start2 + 10*6000;
        
        while (System.currentTimeMillis() < end2 && run) {
            laskuri2++;
            String something1 = list(lause2);
            System.out.println("Write " + something1);
            String kirjoitus1 = printer.nextLine();
            if (kirjoitus1.equals(something1)) {
                System.out.println("yee");
            } else {
                break;

            }
            System.out.println("You wrote " + laskuri2 + " words");
            keskiarvo.add(laskuri2);

        }

    }


