Author: wmb Date: 2009-08-06 02:14:46 +0200 (Thu, 06 Aug 2009) New Revision: 1282
Modified: cpu/x86/tsc.fth Log: Added h:m:s display form for timing words.
Modified: cpu/x86/tsc.fth =================================================================== --- cpu/x86/tsc.fth 2009-08-06 00:14:04 UTC (rev 1281) +++ cpu/x86/tsc.fth 2009-08-06 00:14:46 UTC (rev 1282) @@ -41,12 +41,29 @@ \ Timing tools 2variable timestamp : t( ( -- ) tsc@ timestamp 2! ; +: ))t ( -- d.ticks ) tsc@ timestamp 2@ d- ; : )t ( -- ) - tsc@ timestamp 2@ d- us-factor um/mod nip ( microseconds ) + ))t us-factor um/mod nip ( microseconds ) push-decimal <# u# u# u# [char] , hold u# u#s u#> type ." uS " pop-base ; +: )t-sec ( -- ) + ))t us-factor d# 1,000,000 * um/mod nip ( seconds ) + push-decimal + <# u# u#s u#> type ." S " + pop-base +; +: .hms ( seconds -- ) + d# 60 /mod d# 60 /mod ( sec min hrs ) + push-decimal + <# u# u#s u#> type ." :" <# u# u# u#> type ." :" <# u# u# u#> type + pop-base +; +: )t-hms + ))t us-factor d# 1,000,000 * um/mod nip ( seconds ) + .hms +;
\ LICENSE_BEGIN \ Copyright (c) 2006 FirmWorks
openfirmware@openfirmware.info