<commit_before>'use strict';

var shark = require('../index.js');

shark.init('127.0.0.1:6969');
var loop = shark.loop;

function act(event){
    console.log("Running...");
}

loop(act,2000);<commit_msg>UPDATE: loop example<commit_after>'use strict';

var shark = require('../index.js');

shark.init('127.0.0.1:6969');
var loop = shark.loop;

function act(event){
    console.log("Running...");
    event.serial.info(function(data){
        console.log(data.count);
    });
}

loop(act,2000);
{'fraction_non_alphanumeric': 0.21747967479674796, 'fraction_numerical': 0.056910569105691054, 'mean_word_length': 4.030612244897959, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2798683', 'n_tokens_mistral': 197, 'n_tokens_neox': 178, 'n_words': 29}