using system.nanotime instead of counter