Commit 6f84ed92

6f84ed92e8c5Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 3 files · +1 added · ~2 modified

Description

feat: Time basics with Time.now, Time.at, to_i, and difference

Add sp_Time built-in type wrapping C time_t:

  • New SPINEL_TYPE_TIME in the type system
  • sp_Time runtime: sp_Time_now, sp_Time_at, sp_Time_to_i, sp_Time_diff
  • Time.now and Time.at(n) class method dispatch
  • Time#to_i and Time#- instance method dispatch
  • Uses C time() for implementation

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
6f84ed92e8c5
Parent
21800ec90340

examples/bm_time.rbaddedView file

1+t = Time.now
2+puts t.to_i > 0 # true
3+puts "done"