Added current-time, time?, and time-seconds.

This commit is contained in:
Abdulaziz Ghuloum
2007-12-05 02:35:14 -05:00
parent 171604d7fc
commit 553c986253
4 changed files with 18 additions and 32 deletions
+13
View File
@@ -1007,6 +1007,19 @@ ikrt_stats_now(ikp t, ikpcb* pcb){
return void_object;
}
ikp
ikrt_current_time(ikp t){
struct timeval s;
gettimeofday(&s, 0);
/* this will break in 8,727,224 years if we stay in 32-bit ptrs */
ref(t, off_record_data + 0*wordsize) = fix(s.tv_sec / 1000000);
ref(t, off_record_data + 1*wordsize) = fix(s.tv_sec % 1000000);
ref(t, off_record_data + 2*wordsize) = fix(s.tv_usec);
return t;
}
ikp
ikrt_bytes_allocated(ikpcb* pcb){
int bytes_in_heap = ((int) pcb->allocation_pointer) -