How is it possible to make an app that changes between color automatically after specific time. My code doesn't work for some reason

```
    Random r = new Random();
    Timer t = new Timer();
    LinearLayout ll = (LinearLayout) findViewById(R.id.ll);

    long m = System.nanoTime();
    int seconds = (int) (m/1000);

    if(seconds <= 5){
       ll.setBackgroundColor(Color.BLACK);
    }else{
       ll.setBackgroundColor(Color.WHITE);
    }

```

For ex. the screen is black and after specific time white. And that the time decreases itslef, the changing goes faster.