diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-05-24 23:26:18 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-05-24 23:26:18 +0200 |
commit | 59f7647cd97c62ab7a26725e5a166dcb54b27bc6 (patch) | |
tree | 34dad1189e803af0b8d1d3caa83cd220a950bc3f /include | |
parent | 4d6b1aa2c7ea67d6909680254b7ae68aa437a6ef (diff) | |
download | libssh-59f7647cd97c62ab7a26725e5a166dcb54b27bc6.tar.gz libssh-59f7647cd97c62ab7a26725e5a166dcb54b27bc6.tar.xz libssh-59f7647cd97c62ab7a26725e5a166dcb54b27bc6.zip |
Introduced ssh_timeout_elapsed functions
Functions to mesure elapsed time before and after a serie of
calls. Introduces a dependancy to clock_gettime() and librt,
hope this doesn't break anything. Porting to gettimeofday() should
not be too hard.
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/misc.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libssh/misc.h b/include/libssh/misc.h index 3ee26a3c..9897c4eb 100644 --- a/include/libssh/misc.h +++ b/include/libssh/misc.h @@ -50,6 +50,11 @@ struct ssh_iterator { const void *data; }; +struct ssh_timestamp { + long seconds; + long useconds; +}; + struct ssh_list *ssh_list_new(void); void ssh_list_free(struct ssh_list *list); struct ssh_iterator *ssh_list_get_iterator(const struct ssh_list *list); @@ -72,4 +77,8 @@ const void *_ssh_list_pop_head(struct ssh_list *list); #define ssh_list_pop_head(type, ssh_list)\ ((type)_ssh_list_pop_head(ssh_list)) +void ssh_timestamp_init(struct ssh_timestamp *ts); +int ssh_timeout_elapsed(struct ssh_timestamp *ts, int timeout); +int ssh_timeout_update(struct ssh_timestamp *ts, int timeout); + #endif /* MISC_H_ */ |