Skip to content

Instantly share code, notes, and snippets.

@dongliu
Created November 16, 2012 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongliu/4091106 to your computer and use it in GitHub Desktop.
Save dongliu/4091106 to your computer and use it in GitHub Desktop.
snapshot node
start = Date.now();
size = pv_list.length;
pv_list.forEach(function(pv) {
ca.exec('caget', pv, function(err, result) {
complete = complete + 1;
if (err) {
results[pv] = {
name: pv,
value: 'unavailable'
};
} else {
results[pv] = ca.parseCaget(result);
}
if (complete == size) {
console.log('the snapshot took ' + (Date.now() - start) + ' milliseconds.');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment